dlvhdr/diffnav
Fork: 12 Star: 578 (更新于 2026-01-13 02:30:37)
license: MIT
Language: Go .
A git diff pager based on delta but with a file tree, à la GitHub.
最后发布版本: v0.10.0 ( 2026-02-17 02:54:34)
diffnav
A git diff pager based on delta but with a file tree, à la GitHub.
Demo
Installation
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
Usage
Pipe into diffnav
git diff | diffnavgh pr diff https://github.com/dlvhdr/gh-dash/pull/447 | diffnav
Set up as global git diff pager
git config --global pager.diff diffnav
Configuration
The config file is searched in this order:
$DIFFNAV_CONFIG_DIR/config.yml(if env var is set)$XDG_CONFIG_HOME/diffnav/config.yml(if set, macOS only)~/.config/diffnav/config.yml(macOS and Linux)- OS-specific config directory (e.g.,
~/Library/Application Support/diffnav/config.ymlon macOS)
Example config file:
ui:
# Hide the header to get more screen space for diffs
hideHeader: true
# Hide the footer (keybindings help)
hideFooter: true
# Start with the file tree hidden (toggle with 'e')
showFileTree: false
# Customize the file tree width (default: 26)
fileTreeWidth: 30
# Customize the search panel width (default: 50)
searchTreeWidth: 60
| Option | Type | Default | Description |
|---|---|---|---|
ui.hideHeader |
bool | false |
Hide the "DIFFNAV" header |
ui.hideFooter |
bool | false |
Hide the footer with keybindings help |
ui.showFileTree |
bool | true |
Show file tree on startup |
ui.fileTreeWidth |
int | 26 |
Width of the file tree sidebar |
ui.searchTreeWidth |
int | 50 |
Width of the search panel |
Delta
You can also configure the diff rendering through delta. Check out their docs.
If you want the exact delta configuration I'm using - it can be found here.
Keys
| 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 |
| y | Copy file path |
| o | Open file in $EDITOR |
| Tab | Switch focus between the panes |
| q | Quit |
Under the hood
diffnav uses:
- Bubble Tea for the TUI
deltafor viewing the diffed file
Screenshots use:
- kitty for the terminal
- tokyonight for the color scheme
- CommitMono for the font
最近版本更新:(数据更新于 2026-02-18 04:30:58)
2026-02-17 02:54:34 v0.10.0
2026-02-08 01:21:37 v0.9.0
2026-02-07 03:27:35 v0.8.2
2026-02-01 04:25:20 v0.8.1
2026-02-01 04:17:52 v0.8.0
2026-01-30 22:28:42 v0.7.0
2026-01-18 01:46:50 v0.6.0
2026-01-14 17:34:43 v0.5.0
2026-01-10 01:09:20 v0.4.0
2025-05-11 02:15:49 v0.3.1
主题(topics):
cli, delta, diff, git, github, golang, tui
dlvhdr/diffnav同语言 Go最近更新仓库
2026-03-10 18:52:02 golangci/golangci-lint
2026-03-09 19:33:44 sbondCo/Watcharr
2026-03-09 18:59:12 charmbracelet/lipgloss
2026-03-09 18:58:01 charmbracelet/bubbletea
2026-03-09 17:33:06 semaphoreui/semaphore
2026-03-09 15:19:18 Ullaakut/cameradar