Skip to content

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.toml at 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.

theme = "github-dark-default"
mode = "auto"
vcs = "git"
watch = false
exclude_untracked = false
line_numbers = true
tab_width = 4
wrap_lines = false
hunk_headers = true
menu_bar = true
agent_notes = false
transparent_background = false

Use only the keys you want to change; built-in defaults fill the rest.

mode = "auto"
[vcs]
watch = true
[pager]
menu_bar = false
wrap_lines = true

Command 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]:

SectionApplies 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.

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.