Git Diff Workflow¶
This repo manages a small Git review stack instead of forcing a single tool to do everything:
deltais the default pager for normalgit diff,git show, and other CLI diff output.diffnavis a GitHub-style diff navigator with a file tree, useful when you want to move around larger patches quickly.gh-dashis the GitHub dashboard and review UI; its diff pager is configured to calldiffnav.lazygitstays focused on repo operations inside LazyVim, withdeltaconfigured as its custom pager.
Managed Config Files¶
This workflow is managed globally through these files:
~/.gitconfigkeepsdeltaas the default Git pager.~/.config/gh-dash/config.ymlsetspager.diff: "diffnav".~/.config/lazygit/config.ymluses LazyGit's currentgit.diffRendererssyntax withdelta, setsos.copyToClipboardCmdsoCtrl+Ocopies through thexwrapper (localwl-copy/xclip, OSC 52 over SSH — see clipboard.md), and provides the read-onlyIlocal/remote-main containment report described in lazygit.~/.config/bat/themes/tokyonight_night.tmThemeprovides the shared Tokyo Night theme used bybatpreviews.
Why Both delta and diffnav¶
delta is still the best default for everyday Git CLI output. It is fast, readable, and already fits git diff and LazyGit well.
diffnav solves a different problem: navigating large review diffs with a file tree and a GitHub-like layout. That makes it a better fit for gh-dash than replacing delta everywhere.
gh-dash + diffnav¶
gh-dash is installed as a gh extension and reads the global config at ~/.config/gh-dash/config.yml. This repo intentionally keeps that config minimal:
That gives gh-dash a better diff viewer without importing personalized sections, colors, or keybindings from other dotfiles.
Before using gh-dash, authenticate GitHub CLI once:
LazyGit + delta¶
Since v0.64, LazyGit's diff renderer configuration uses git.diffRenderers
and command. The former git.pagers and pager fields trigger an automatic
migration that rewrites the config file on startup:
git:
diffRenderers:
- colorArg: always
command: delta --dark --paging=never --syntax-theme base16-256 -s
The lazyvim_deps role enforces LazyGit >= 0.64.0. It upgrades an old
Homebrew-managed formula directly, then falls back to the checksum-verified
official release when another install or PATH shadow still exposes an older
binary. This is a narrow minimum-version repair, not a general upgrade policy.
This keeps LazyGit aligned with the existing delta-first CLI setup while
preventing migration drift against the chezmoi-managed file.
Fonts and Theme¶
Both diffnav and gh-dash look better with a Nerd Font because their interfaces rely on icon glyphs. This repo already manages Hack Nerd Font on desktop profiles.
The bat Tokyo Night warning ([bat warning]: Unknown theme 'tokyonight_night', using default., printed on every delta render) is fixed by managing the upstream tokyonight_night.tmTheme file directly and compiling it into bat's cache after apply.
bat never reads .tmTheme at runtime — only the bincode cache under ~/.cache/bat, which bat cache --build writes. That cache lives outside chezmoi's control, so .chezmoiscripts/global/run_after_25_bat_theme.sh.tmpl re-checks it on every apply (cache present? written by the current bat version? newer than the theme source?) and rebuilds only when stale. dot_config/shell/25_bat.sh correspondingly exports BAT_THEME only when the compiled cache exists, so a host without one falls back to bat's default silently instead of warning on every line. See pitfalls/bat-theme-cache-cleared-never-rebuilt.md.
References¶
- gh-dash cheat-sheet — views, search, keys, Herdr hotkeys
- diffnav
- gh-dash docs
- LazyGit custom diff renderers
- bat