A git diff pager based on delta but with a file tree, à la GitHub.
Caution
This is early in development, bugs are to be expected.
Feel free to open issues.
Homebrew:
brew install dlvhdr/formulae/diffnav
Go:
go install github.com/dlvhdr/diffnav@latest
Note
To get the icons to render properly you should download and install a Nerd font from https://www.nerdfonts.com/. Then, select that font as your font for the terminal.
You can install these with brew as well: brew install --cask font-<FONT NAME>-nerd-font
git diff | diffnav
gh pr diff https://github.com/dlvhdr/gh-dash/pull/447 | diffnav
git config --global pager.diff diffnav
- Currently you can configure
diffnav
only through delta so check out their docs. - If you want the exact configuration I'm using - it can be found here.
Key | Description |
---|---|
j | Next file |
k | Previous file |
Ctrl-d | Scroll the diff down |
Ctrl-u | Scroll the diff up |
e | Toggle the file tree |
t | Search/go-to file |
q | Quit |
diffnav
uses:
- Bubble Tea for the TUI
delta
for viewing the diffed file
Screenshots use:
- kitty for the terminal
- tokyonight for the color scheme
- CommitMono for the font