A compact alternative to Hunk's built-in files pane that keeps filenames readable in narrow sidebars, especially in projects with deeply nested directories.
| Built-in files pane | hunk-compact-filenav |
|---|---|
Both panes show the same eight changed files at the same width. The compact pane uses one header per directory, leaving more room for filenames.
- Directories use one row instead of one row per path segment.
- Common extensions are hidden when they add no useful information.
- Similar paths and filenames keep enough detail to remain distinguishable.
- Long paths are shortened in the middle, preserving useful segments at both ends.
- Filenames are shortened from the front so their distinctive endings remain.
- Change counts are removed before filenames.
These changes happen dynamically, based on the current changeset and the space available. The most useful information stays visible for as long as possible.
Requires Hunk 0.21.1 or newer.
hunk extension install rschoch/hunk-compact-filenavTo install a specific release:
hunk extension install rschoch/hunk-compact-filenav@v0.1.0To try a local checkout without installing it:
hunk diff --extension /path/to/hunk-compact-filenavThe local directory must be named hunk-compact-filenav, because Hunk uses the
directory name as the extension ID.
Press ctrl+p to switch between this extension and Hunk's built-in files pane.
Filtering, file selection, and [/] navigation continue to work as usual.
All options are optional:
[extension.hunk-compact-filenav]
keep_prefix_segments = 1
keep_suffix_segments = 1
always_compact = false
keep_extension = "auto" # "auto", "always", or "never"
ellipsis = "…" # up to 3 columns widekeep_prefix_segments and keep_suffix_segments control how many directory
segments are always shown. Set always_compact to true to shorten every path,
including paths that would otherwise fit.