A fast, opinionated Neovim configuration that opens to a live unified Git diff panel with a project tree. Designed for code review, staging, and multi‑repo workflows. Optimized to pair with LLMs, code‑instruct models, and coding agents (Claude Code, ChatGPT/Codex, OpenCode, Cursor, Copilot, Aider, Code Llama, DeepSeek Coder, etc.). Includes Telescope, Nvim‑Tree, Gitsigns, Diffview, Fugitive, LSP (Mason + nvim‑lspconfig), nvim‑cmp + Copilot, Toggleterm, and Catppuccin.
Demo: add a short GIF at docs/demo.gif for best results on GitHub
- Diff‑first startup: unified Git diff + project tree
- Multi‑repo aware (recursively scans nested repos)
- Live auto‑refresh on save and file changes
- One‑keystroke jump from diff to the exact file/line
- Rich Git UX: Gitsigns hunks, Fugitive commands, Diffview history/merges
- Productive defaults: Telescope, Nvim‑Tree, Toggleterm
- LSP in minutes: Mason + LSPConfig + nvim‑cmp (+ Copilot)
- Beautiful out of the box (Catppuccin Mocha), CUDA/PTX syntax
- Diff‑first layout produces clean unified patches that LLMs/agents can reason about and generate.
- One‑keystroke jump to file/line lets you copy minimal, targeted context into chat prompts.
- Multi‑repo aware: tame monorepos and present agents focused, curated diffs.
- Toggleterm makes it easy to run agents and CLIs side‑by‑side (Claude Code, opencode, cursor‑agent, aider, copilot‑cli, openai tools).
- Telescope live_grep and file pickers act as fast RAG/context retrieval for your prompts.
- Gitsigns hunk staging maps perfectly to “apply just this change” workflows.
- Diffview gives high‑signal review of agent‑generated branches/PRs.
- LSP + completion support tight “fix diagnostics” and “rename/format” loops suggested by models.
- Catppuccin theme keeps diffs readable for copy/paste into chats.
- Open your repo root and launch
nvim(auto‑opens diff panel) - Use
<leader>gdto focus the diff,goto open target lines - Pull context with Telescope (
<C-p>,<leader>fg) and paste into chat - Ask your model for a unified diff or patch; apply via Toggleterm (e.g.,
git apply -p0 -) - Stage selectively with Gitsigns hunks or Fugitive
- Inspect history/merges with Diffview (
<leader>gD), then commit
Prereqs: Neovim ≥ 0.9, git, ripgrep (for Telescope live_grep)
Option A
- Back up your current config:
mv ~/.config/nvim ~/.config/nvim.bak - Copy this folder to
~/.config/nvim - Launch:
nvim(lazy.nvim bootstraps automatically)
Option B
- Clone this repo into
~/.config/nvim - Launch:
nvim
Tips
- First run installs plugins automatically; if not, run
:Lazy :Keysshows keybindings at any time
- Startup: with no file args, the diff panel opens by default
- Anytime:
<leader>gdopens panel;<leader>gDopens Diffview - Inside panel:
Enteror double‑click previews a file’s diff,goopens the file at the mapped line,qcloses - Multi‑repo: panel aggregates changes from nested repos under your cwd
- Files/search:
<C-p>find files,<leader>fglive grep,<leader>efile tree - Git panel:
<leader>gdopen,Enter/double‑click to preview a file’s diff,qclose,goopen file at cursor line - Diffview:
<leader>gDopen - Gitsigns:
<leader>gppreview hunk,<leader>gureset hunk,<leader>gUreset buffer,<leader>gnnext hunk,<leader>gNprev hunk - LSP:
gDdeclaration,gddefinition,Khover,giimplementation,<C-k>signature,<leader>wa/wr/wlworkspace,<leader>Dtype,<leader>rnrename,<leader>cacode action,grreferences,<leader>fformat - Terminal:
<C-\>toggle floating terminal
Default layout when opening the unified diff panel (<leader>gd):
+---------------------------+------------------------------------------------------+
| Changed Files | Unified Diff |
| src/ | diff --git a/src/foo.lua b/src/foo.lua |
| foo.lua +12 -4 | @@ -1,5 +1,7 @@ |
| bar.ts +3 -0 | -local old = 1 |
| README.md +2 -0 | +local new = 2 |
| | ... |
|---------------------------+ |
| File Tree | |
| project/ | |
| ├─ src/ | |
| │ ├─ foo.lua | |
| │ └─ bar.ts | |
| └─ README.md | |
+---------------------------+------------------------------------------------------+
Notes
- Left: top shows changed files (+added/−removed), bottom shows project tree
- Right: unified diff with add/remove/context highlighting
- Keys:
<leader>gdopen,Enterto load diff,qclose
- Scan depth: set
vim.g.git_multi_repo_max_depth(default 3) - Rescan interval (ms): set
vim.g.git_multi_repo_scan_interval_ms(default 10000) - Theme: Catppuccin Mocha palette
- Disable auto‑open on start: remove the VimEnter autocmd in lua/config/autocmds.lua:45‑51
- Commands:
:Keys,:GitDiff
- Core: folke/lazy.nvim
- UI: nvim-tree/nvim-tree.lua, catppuccin/nvim, akinsho/toggleterm.nvim
- Search: nvim-telescope/telescope.nvim
- Git: lewis6991/gitsigns.nvim, tpope/vim-fugitive, sindrets/diffview.nvim
- LSP: williamboman/mason.nvim, williamboman/mason-lspconfig.nvim, neovim/nvim-lspconfig
- Completion: hrsh7th/nvim-cmp, hrsh7th/cmp-nvim-lsp, hrsh7th/cmp-buffer, hrsh7th/cmp-path, L3MON4D3/LuaSnip, saadparwaiz1/cmp_luasnip, zbirenbaum/copilot.lua, zbirenbaum/copilot-cmp
- Extras: bfrg/vim-cuda-syntax, leafgarland/typescript-vim
- Open diff panel mapping: lua/plugins/fugitive.lua:6
- Diffview mapping: lua/plugins/diffview.lua:86
- Panel keys: Enter/Double‑Click to preview, go to open, q to close (lua/config/git_diff_panel.lua:658‑711)
:Keys/:GitDiffcommands and auto‑open: lua/config/autocmds.lua:37‑51
- Telescope
live_greprequires ripgrep (rg) in PATH - If highlights look off, ensure Catppuccin is installed and selected
- Neovim 0.9+ recommended (uses modern APIs)
- Health check:
:checkhealth
- How do I revert to my old config? Move back your backup:
rm -rf ~/.config/nvim && mv ~/.config/nvim.bak ~/.config/nvim - How do I disable auto‑open diff on start? See lua/config/autocmds.lua:45‑51
- Does this work with Claude/ChatGPT/Cursor/OpenCode/Copilot/etc.? Yes — it’s editor/agent agnostic and designed to surface diffs and focused context fast.
neovim git, neovim git diff, neovim git panel, unified diff, multi repo git, neovim config, neovim setup, vim git, gitsigns.nvim, diffview.nvim, vim‑fugitive, telescope.nvim, nvim‑tree, lazy.nvim, mason.nvim, nvim‑lspconfig, nvim‑cmp, copilot, toggleterm, catppuccin, code review, staging, developer productivity, llm, ai pair programming, coding agents, code‑instruct models, claude code, chatgpt, openai codex, opencode, cursor, cursor‑agent, aider, copilot‑cli, code llama, deepseek coder, rag, retrieval augmented generation, patch, unified diff workflow