Skip to content
vic

dlvhdr/diffnav

A git diff pager based on delta but with a file tree, à la GitHub.

dlvhdr/diffnav.json
{
"createdAt": "2024-09-18T14:41:16Z",
"defaultBranch": "main",
"description": "A git diff pager based on delta but with a file tree, à la GitHub.",
"fullName": "dlvhdr/diffnav",
"homepage": "",
"language": "Go",
"name": "diffnav",
"pushedAt": "2026-01-17T17:30:20Z",
"stargazersCount": 589,
"topics": [
"cli",
"delta",
"diff",
"git",
"github",
"golang",
"tui"
],
"updatedAt": "2026-01-19T07:49:03Z",
"url": "https://github.com/dlvhdr/diffnav"
}

A git diff pager based on delta but with a file tree, à la GitHub.

Demo

Homebrew:

Terminal window
brew install dlvhdr/formulae/diffnav

Go:

Terminal window
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
Terminal window
git config --global pager.diff diffnav
FlagDescription
--side-by-side, -sForce side-by-side diff view
--unified, -uForce unified diff view

Example:

Terminal window
git diff | diffnav --unified
git diff | diffnav -u

The config file is searched in this order:

  1. $DIFFNAV_CONFIG_DIR/config.yml (if env var is set)
  2. $XDG_CONFIG_HOME/diffnav/config.yml (if set, macOS only)
  3. ~/.config/diffnav/config.yml (macOS and Linux)
  4. OS-specific config directory (e.g., ~/Library/Application Support/diffnav/config.yml on 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
# Icon style: "nerd-fonts" (default), "nerd-fonts-alt", "unicode", or "ascii"
icons: nerd-fonts
# Color filenames by git status (default: true)
colorFileNames: false
# Use side-by-side diff view (default: true, set false for unified)
sideBySide: true
OptionTypeDefaultDescription
ui.hideHeaderboolfalseHide the “DIFFNAV” header
ui.hideFooterboolfalseHide the footer with keybindings help
ui.showFileTreebooltrueShow file tree on startup
ui.fileTreeWidthint26Width of the file tree sidebar
ui.searchTreeWidthint50Width of the search panel
ui.iconsstringnerd-fontsIcon style: nerd-fonts, nerd-fonts-alt, unicode, or ascii
ui.colorFileNamesbooltrueColor filenames by git status
ui.sideBySidebooltrueUse side-by-side diff view (false for unified)

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.

KeyDescription
jNext file
kPrevious file
Ctrl-dScroll the diff down
Ctrl-uScroll the diff up
eToggle the file tree
tSearch/go-to file
yCopy file path
iCycle icon style
oOpen file in $EDITOR
sToggle side-by-side/unified view
TabSwitch focus between the panes
qQuit

diffnav uses:

Screenshots use: