# Diffnav Configuration TUI git diff pager that wraps [[delta]] with a GitHub-style file tree navigator. Brings the PR review experience to the terminal: collapsible file tree on the left, syntax-highlighted diff on the right. Config file: `~/.config/diffnav/config.yml` > [!info] What is diffnav? > diffnav is a terminal UI built with Bubble Tea (Go) by Dhruv Ahuja (dlvhdr). It shells out to delta for syntax-highlighted diff rendering — meaning all `[delta]` git config settings (side-by-side, line-numbers, navigate) are inherited automatically. The file tree is diffnav's own layer on top, showing added/modified/deleted files with nerd font icons. Press `o` to open the current file in `$EDITOR`. ## Key Settings | Setting | Value | Why | |---------|-------|-----| | `showFileTree` | `true` | Primary feature — file navigator on the left | | `fileTreeWidth` | `30` | Enough width for long paths without crowding the diff | | `icons` | `nerd-fonts-filetype` | Language-specific icons (JetBrainsMono Nerd Font) | | `colorFileNames` | `true` | Added/modified/deleted colored in the tree | | `showDiffStats` | `true` | +/- line counts per file | | `sideBySide` | `true` | Matches `[delta] side-by-side = true` | ## Key Bindings ### File Tree Navigation | Key | Action | |-----|--------| | `Tab` | Toggle file tree focus | | `j` / `k` | Navigate files in tree | | `Enter` | Jump to file diff | | `Space` | Collapse/expand folder | ### Diff Viewing | Key | Action | |-----|--------| | `n` / `N` | Next / previous diff hunk | | `]f` / `[f` | Next / previous file | | `o` | Open file in `$EDITOR` (nvim) | | `gg` / `G` | Top / bottom of diff | ### General | Key | Action | |-----|--------| | `q` | Quit diffnav | | `?` | Help overlay | ## Default Keys | Key | Description | | :---------------- | :------------------------------- | | <kbd>j</kbd> | Next file | | <kbd>k</kbd> | Previous file | | <kbd>Ctrl-d</kbd> | Scroll the diff down | | <kbd>Ctrl-u</kbd> | Scroll the diff up | | <kbd>e</kbd> | Toggle the file tree | | <kbd>t</kbd> | Search/go-to file | | <kbd>y</kbd> | Copy file path | | <kbd>i</kbd> | Cycle icon style | | <kbd>o</kbd> | Open file in $EDITOR | | <kbd>s</kbd> | Toggle side-by-side/unified view | | <kbd>Tab</kbd> | Switch focus between the panes | | <kbd>q</kbd> | Quit | ## Integration ### Git Pager Config (`~/.gitconfig`) ```ini [pager] diff = diffnav show = diffnav ``` `log` is intentionally excluded — plain `git log` produces no diff output, which results in an empty diffnav UI. Use `git log -p | diffnav` explicitly when needed. ### Tmux Keybindings (`~/.tmux.conf`) | Binding | Command | Description | |---------|---------|-------------| | `prefix + D` | `git diff \| diffnav` | Working tree diff in popup | | `prefix + S` | `git diff --staged \| diffnav` | Staged diff in popup | Both use `display-popup -E` at 90% dimensions — the popup closes automatically when diffnav exits (`q`). ### Shell Aliases | Alias | Expands to | Description | |-------|-----------|-------------| | `gdnb` | `git diff $(git merge-base HEAD main)..HEAD \| diffnav` | All changes since diverging from main | | `ghdn` | `gh pr diff \| diffnav` | Open PR diff from GitHub | Simple `git diff` and `git diff --staged` route through diffnav automatically via the `[pager]` config — no alias needed. ## Workflow diffnav fits naturally into the [[Claude Focus Workflow]] review phase: 1. **Quick working-tree check** — `prefix + D` in tmux before a commit 2. **Pre-commit staged review** — `prefix + S` to verify exactly what's going in 3. **Branch PR review** — `gdnb` to see all changes since diverging from main 4. **GitHub PR review** — `ghdn` on any repo with an open PR