From 34950b204aaf02ffcedca318825c813d7badfdab Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Tue, 27 Oct 2026 19:59:18 +0000 Subject: [PATCH 1/2] Add review.nvim for typed review comments on top of codediff Comments on lines, ranges or files, exported as markdown to the clipboard so feedback on agent output is pasted rather than retyped. Keeps the existing codediff mappings, which handle repos where origin has no cached HEAD and shas under the cursor. Bumps codediff to 4.0.6, which review.nvim's lifecycle hooks need; the other plugins moved too because vim.pack updates them together. Co-Authored-By: Claude Fable 5.1 --- neovim/config/plugins/init.lua | 1 + neovim/config/plugins/review.lua | 26 ++++++++++++++++++++++++++ neovim/config/plugins/which-key.lua | 1 + neovim/nvim-pack-lock.json | 18 +++++++++++++----- 4 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 neovim/config/plugins/review.lua diff --git a/neovim/config/plugins/init.lua b/neovim/config/plugins/init.lua index ea9535b..8fd9d54 100644 --- a/neovim/config/plugins/init.lua +++ b/neovim/config/plugins/init.lua @@ -4,5 +4,6 @@ require('config.plugins.codediff') require('config.plugins.fzf-lua') require('config.plugins.gitsigns') require('config.plugins.nvim-tree') +require('config.plugins.review') require('config.plugins.web-devicons') require('config.plugins.which-key') diff --git a/neovim/config/plugins/review.lua b/neovim/config/plugins/review.lua new file mode 100644 index 0000000..68649fe --- /dev/null +++ b/neovim/config/plugins/review.lua @@ -0,0 +1,26 @@ +-- Typed review comments on top of codediff, exported as markdown for an agent. +-- nui.nvim draws the comment popup. +vim.pack.add({ + 'https://github.com/MunifTanjim/nui.nvim', + 'https://github.com/georgeguimaraes/review.nvim', +}) + +require('review').setup({ + -- base = nil: origin's cached HEAD, then main or master. The codediff + -- mappings (gm, gR) keep the fuller remote fallback for + -- repos where origin has no cached HEAD. + branch = { base = nil }, + export = { + -- Clipboard is the whole loop: q exports, then paste into Claude Code. + clipboard = true, + }, +}) + +local function map(mode, lhs, rhs, desc) + vim.keymap.set(mode, lhs, rhs, { desc = desc }) +end + +map('n', 'rr', 'Review', 'Review working tree') +map('n', 'rb', 'Review branch', 'Review branch') +map('n', 'rc', 'Review commits', 'Review commits') +map({ 'n', 'v' }, 'rn', 'Review note', 'Review note') diff --git a/neovim/config/plugins/which-key.lua b/neovim/config/plugins/which-key.lua index a663754..8463cb9 100644 --- a/neovim/config/plugins/which-key.lua +++ b/neovim/config/plugins/which-key.lua @@ -10,5 +10,6 @@ wk.add({ { 'f', group = 'find' }, { 'g', group = 'diff' }, { 'h', group = 'hunks' }, + { 'r', group = 'review' }, { 't', group = 'toggles' }, }) diff --git a/neovim/nvim-pack-lock.json b/neovim/nvim-pack-lock.json index 9508372..551914b 100644 --- a/neovim/nvim-pack-lock.json +++ b/neovim/nvim-pack-lock.json @@ -5,25 +5,33 @@ "src": "https://github.com/catppuccin/nvim" }, "codediff.nvim": { - "rev": "e08a35a56a52c290398ebfaec33c34cfcf2d0f3c", + "rev": "09d9ebef2cc5a5c04db7a349cd6c61bdf84ecc8e", "src": "https://github.com/esmuellert/codediff.nvim" }, "fzf-lua": { - "rev": "8671012a7b2a1648595952c655039d51fb301c14", + "rev": "5b88d6f0af7fcb41d4a8bb340bf70d7e3824ee9d", "src": "https://github.com/ibhagwan/fzf-lua" }, "gitsigns.nvim": { - "rev": "31d6fb2d618bca1482b9f274751ead5f03461408", + "rev": "d4854fa9a94b5c8b37dd209fb4a19e98e764186f", "src": "https://github.com/lewis6991/gitsigns.nvim" }, + "nui.nvim": { + "rev": "10fc361835c856ba4233ef5ea135b919bf3dce97", + "src": "https://github.com/MunifTanjim/nui.nvim" + }, "nvim-tree.lua": { - "rev": "b2aadda94b107480c48e548d6db51c6840b7b33c", + "rev": "3be8cad084e79e84833ef98cef88116c26a224ff", "src": "https://github.com/nvim-tree/nvim-tree.lua" }, "nvim-web-devicons": { - "rev": "2ae6958df7ced50baac5035cec0c15799eedfbf7", + "rev": "ec309a0eaff6ea967e58c275996155ab5c16938d", "src": "https://github.com/nvim-tree/nvim-web-devicons" }, + "review.nvim": { + "rev": "0a379fae01709645956005f76c4650b7740931a3", + "src": "https://github.com/georgeguimaraes/review.nvim" + }, "which-key.nvim": { "rev": "3aab2147e74890957785941f0c1ad87d0a44c15a", "src": "https://github.com/folke/which-key.nvim" From e08861b1c6dc951e260460eee6bfdb68ceddfda5 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Sat, 31 Oct 2026 16:28:18 +0000 Subject: [PATCH 2/2] Wrap markdown at 80 with a colour column guide Hand-wrapping CLAUDE.md showed there was no visual guide for line length. textwidth makes gq reflow to 80 and colorcolumn marks column 81, markdown only so PHP is unaffected. The ftplugin directory is linked whole so later filetypes need no bootstrap change. Co-Authored-By: Claude Fable 5.1 --- bootstrap.sh | 2 ++ neovim/after/ftplugin/markdown.lua | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 neovim/after/ftplugin/markdown.lua diff --git a/bootstrap.sh b/bootstrap.sh index dcc8bad..e2d026d 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -45,6 +45,8 @@ test -d $HOME/.config/nvim/lua || mkdir -p $HOME/.config/nvim/lua test -L $HOME/.config/nvim/lua/config || ln -f -s $BASEDIR/neovim/config $HOME/.config/nvim/lua/config test -d $HOME/.config/nvim/lsp || mkdir -p $HOME/.config/nvim/lsp test -L $HOME/.config/nvim/lsp/phpactor.lua || ln -f -s $BASEDIR/neovim/lsp/phpactor.lua $HOME/.config/nvim/lsp/phpactor.lua +test -d $HOME/.config/nvim/after || mkdir -p $HOME/.config/nvim/after +test -L $HOME/.config/nvim/after/ftplugin || ln -f -s $BASEDIR/neovim/after/ftplugin $HOME/.config/nvim/after/ftplugin # Claude Code statusline test -d $HOME/.claude || mkdir $HOME/.claude diff --git a/neovim/after/ftplugin/markdown.lua b/neovim/after/ftplugin/markdown.lua new file mode 100644 index 0000000..bc1c9e9 --- /dev/null +++ b/neovim/after/ftplugin/markdown.lua @@ -0,0 +1,4 @@ +-- Hard-wrap prose at 80, the markdownlint/prettier default. +1 puts the guide +-- just past the limit, so a line touching it is still fine. +vim.bo.textwidth = 80 +vim.wo.colorcolumn = '+1'