Small Neovim plugin for reviewing a Git changeset one file at a time.
Instead of scrolling through one combined diff, review.nvim opens each changed
file in a review tab and uses Fugitive's :Gvdiffsplit to compare your working
copy against a base revision. The editable working-copy buffer stays focused, so
normal LSP, Treesitter, diagnostics, and mappings continue to work while you
review.
- Neovim 0.9+
- Git
- vim-fugitive
With lazy.nvim:
{
"rubenpouwen/review.nvim",
dependencies = { "tpope/vim-fugitive" },
keys = {
{ "<leader>Rs", function() require("review").start() end, desc = "Review changes" },
{ "<leader>Rn", function() require("review").next() end, desc = "Review next file" },
{ "<leader>Rp", function() require("review").prev() end, desc = "Review previous file" },
{ "<leader>Rl", function() require("review").list() end, desc = "Review file list" },
{ "<leader>Rq", function() require("review").quit() end, desc = "Quit review" },
},
}For local development from this config:
{
dir = vim.fn.stdpath("config") .. "/review.nvim",
dependencies = { "tpope/vim-fugitive" },
}| Command | Description |
|---|---|
:ReviewStart [base] |
Start reviewing changed files. Defaults to uncommitted changes vs HEAD. |
:ReviewNext |
Move to the next changed file. |
:ReviewPrev |
Move to the previous changed file. |
:ReviewList |
Pick a changed file from the current review set. |
:ReviewQuit |
Close the review tab and clear review state. |
When a base ref is provided, review.nvim uses git merge-base HEAD <base>
when possible, so :ReviewStart main reviews only the changes introduced on top
of main.
require("review").start({ base = "main" })
require("review").next()
require("review").prev()
require("review").list()
require("review").quit()- Added and untracked files open as normal buffers because there is no base version to diff against.
- Renamed and copied files are reviewed at their new path.
- Deleted files are included in the review set, but opening them depends on how your working tree represents the deleted path.