Configuration
Hunk reads TOML preferences from a user file and an optional repository file:
~/.config/hunk/config.toml(or the platform/XDG config location).hunk/config.tomlat the repository root
Repository settings override user settings. Command sections then override their layer's top-level values, pager sections apply to pager-style sessions, and explicit CLI flags win last.
Start with useful defaults
Section titled “Start with useful defaults”theme = "github-dark-default"mode = "auto"vcs = "git"watch = falseexclude_untracked = falseline_numbers = truetab_width = 4wrap_lines = falsehunk_headers = truemenu_bar = trueagent_notes = falsetransparent_background = falseUse only the keys you want to change; built-in defaults fill the rest.
Scope a command
Section titled “Scope a command”mode = "auto"
[vcs]watch = true
[pager]menu_bar = falsewrap_lines = trueCommand sections are named after the input Hunk parses, which is not always the command you type. In particular, hunk diff on a repository reads [vcs], not [diff]:
| Section | Applies to |
|---|---|
[vcs] | hunk diff working-tree and target reviews |
[show] | hunk show commit reviews |
[stash-show] | hunk stash show reviews |
[diff] | two-file comparisons (hunk diff <left> <right>) |
[patch] | hunk patch reviews |
[difftool] | hunk difftool pair reviews |
[pager] is an overlay applied after the matching command section whenever the invocation uses pager-style behavior.
Save interactive changes
Section titled “Save interactive changes”When you change view preferences and quit, Hunk can offer to persist them. It writes to an existing repository config when one exists; otherwise it keeps personal view choices in the user config. Set prompt_save_view_preferences = false to disable that prompt.
The config reference lists every key, default, and alias. The root-only [extensions] table has its own guide: Extensions.