A Neovim plugin for reviewing and managing file changes made by AI coding CLI tools.
resu.nvim watches your project directory for file modifications and provides a streamlined interface to review, accept, or decline changes. It integrates seamlessly with diffview.nvim for a powerful diff experience, while also providing a built-in fallback UI.
- Neovim >= 0.8.0
- Git (for diff and revert operations)
- diffview.nvim (recommended, optional)
Using lazy.nvim:
{
"koushikxd/resu.nvim",
dependencies = {
"sindrets/diffview.nvim",
},
config = function()
require("resu").setup()
end,
}Using packer.nvim:
use {
"koushikxd/resu.nvim",
requires = { "sindrets/diffview.nvim" },
config = function()
require("resu").setup()
end,
}- Diffview Integration: Uses diffview.nvim for a feature-rich diff interface (default)
- Built-in Fallback UI: Sidebar interface with inline diff visualization when diffview is unavailable
- Real-time File Watching: Automatic change detection with configurable debouncing
- Hot Reload: Automatically reloads buffers when files change on disk
- Git Integration: Stage files on accept, revert to HEAD on decline
- Batch Operations: Accept or decline all pending changes at once
Default configuration:
require("resu").setup({
use_diffview = true,
hot_reload = true,
debounce_ms = 100,
watch_dir = nil,
ignored_files = {
"%.git/",
"node_modules/",
"dist/",
"build/",
"%.DS_Store",
"%.swp",
},
keymaps = {
toggle = "<leader>rt",
accept = "<leader>ra",
decline = "<leader>rd",
accept_all = "<leader>rA",
decline_all = "<leader>rD",
refresh = "<leader>rr",
quit = "q",
},
})| Option | Type | Default | Description |
|---|---|---|---|
use_diffview |
boolean | true |
Use diffview.nvim when available |
hot_reload |
boolean | true |
Auto-reload buffers when files change on disk |
debounce_ms |
number | 100 |
Debounce delay (ms) for file watcher |
watch_dir |
string | nil |
Directory to watch (defaults to cwd) |
ignored_files |
table | see above | Lua patterns for files to ignore |
keymaps |
table | see above | Key mappings for actions |
-
Start working with your AI coding tool (Claude Code, Cursor, etc.)
-
Toggle the review panel:
:ResuToggle-
Review changes in the diff view
-
Accept changes with
<leader>ra(stages the file) or decline with<leader>rd(reverts to HEAD) -
Use
<leader>rAto accept all or<leader>rDto decline all pending changes
| Command | Description |
|---|---|
:ResuOpen |
Open the diff view |
:ResuClose |
Close the diff view |
:ResuToggle |
Toggle the diff view |
:ResuRefresh |
Refresh the view and reload buffers |
:ResuAccept |
Accept/stage current file |
:ResuDecline |
Decline/revert current file to HEAD |
:ResuAcceptAll |
Accept/stage all changes |
:ResuDeclineAll |
Decline/revert all changes |
:ResuReset |
Reset plugin state |
| Key | Action |
|---|---|
<leader>rt |
Toggle diff view |
<leader>ra |
Accept current file |
<leader>rd |
Decline current file |
<leader>rA |
Accept all changes |
<leader>rD |
Decline all changes |
<leader>rr |
Refresh view |
q |
Close panel (in legacy UI) |
| Key | Action |
|---|---|
j |
Next file |
k |
Previous file |
<CR> |
Open file in editor |
q |
Close panel |
- resu.nvim monitors your project directory for file changes using libuv filesystem events
- Changes are displayed using diffview.nvim's powerful diff interface
- Accept stages the file with
git add - Decline reverts the file to HEAD using
git checkout(or removes untracked files) - Hot reload keeps your buffers in sync with disk changes
- A sidebar shows all modified and untracked files
- Inline diffs are rendered using virtual text (additions in green, deletions in red)
- Navigate files with
j/kand press<CR>to view - Accept saves the current buffer state, decline reverts to the git baseline
- Reviewing AI-generated code changes before committing
- Managing incremental modifications from AI coding assistants
- Quick approval or rejection of automated refactoring
- Keeping control over file-level changes in collaborative AI workflows
MIT