| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Note: This is an actively maintained fork of sindrets/diffview.nvim with bug fixes and improvements applied. See doc/diffview_changelog.txt (:h diffview.changelog) for breaking changes and notable additions.
Single tabpage interface for easily cycling through diffs for all modified files for any git rev. Review all changed files, resolve merge conflicts, and browse file history from a unified view.
Supported VCS (at least one required):
-- Lazy
{
"dlyongemallo/diffview-plus.nvim",
version = "*",
-- optional: lazy-load on command
-- cmd = {
-- "DiffviewOpen",
-- "DiffviewToggle",
-- "DiffviewFileHistory",
-- "DiffviewDiffFiles",
-- "DiffviewLog",
-- },
}" Plug
Plug 'dlyongemallo/diffview-plus.nvim':DiffviewOpen " Diff working tree against index
:DiffviewFileHistory % " History for the current file
:DiffviewFileHistory " History for the whole repo
:DiffviewDiffFiles a b " Diff two arbitrary files
:DiffviewClose " Close the current diffviewPress g? in any diffview buffer to see all available keymaps.
See USAGE.md for detailed guides on PR review, stash inspection, and committing workflows.
Diff View — Browse all changed files in a single tabpage. Stage
individual hunks by editing index buffers directly.

File History — List all commits affecting a file, directory, or line
range. Filter by author, message, date range, and more.

Merge Tool — 3-way and 4-way diff layouts for resolving conflicts,
with mappings for choosing OURS/THEIRS/BASE versions.

Staging — Stage and unstage individual files or all changes from the file panel (- / s / S / U). You can stage individual hunks by editing any buffer that represents the index (after running :DiffviewOpen with no [rev] the entries under "Changes" will have the index buffer on the left side, and the entries under "Staged changes" will have it on the right side). Once you write to an index buffer the index will be updated. (Note: Staging is a Git concept. These actions are no-ops on Jujutsu.)
Unified Inline Diff — diff1_inline layout renders adds/deletes in a single window via extmark overlays, with tree-sitter highlights preserved on both added and deleted lines. Configurable via view.inline.style ("unified" / "overleaf").
Multi-file Selection — Select multiple files in the file panel (w to toggle, C to clear) for batch stage / unstage / restore. Selections persist across Neovim restarts.
Pin Local in File History — Run :DiffviewFileHistory --pin-local to keep the working tree on one side while cycling commits on the other (Git only).
| Command | Description |
|---|---|
| :DiffviewOpen [rev] [options] [ -- {paths...}] | Open a diff view |
| :DiffviewFileHistory [paths] [options] | Browse file/commit history |
| :DiffviewDiffFiles {file1} {file2} | Diff two arbitrary files |
| :DiffviewMergeFiles {output} [{base}] {left} {right} | 3-way / 4-way merge editor (no VCS required) |
| :DiffviewDiffDirs {left} {right} [{output}] | Compare two on-disk directories (no VCS required) |
| :DiffviewClose | Close the current diffview. You can also use :tabclose. |
| :DiffviewToggleFiles | Toggle the file panel |
| :DiffviewFocusFiles | Bring focus to the file panel |
| :DiffviewRefresh[!] | Update stats and entries in the file list (with !, also force-reload stage diff buffers) |
Examples:
:DiffviewOpen " Working tree changes
:DiffviewOpen HEAD~2 " Changes since HEAD~2
:DiffviewOpen origin/main...HEAD " Symmetric diff (PR-style)
:DiffviewOpen -- lua/diffview " Limit to specific paths
:DiffviewFileHistory % " Current file history
:'<,'>DiffviewFileHistory " History for selected linesFor full command documentation, see :h diffview-commands.
Important
This plugin builds on nvim's built-in diff mode. Make sure you're familiar with jumping between hunks (:h jumpto-diffs) and applying diff changes (:h copy-diffs).
A minimal configuration showing commonly customised options:
require("diffview").setup({
enhanced_diff_hl = true,
use_icons = true,
view = {
default = { layout = "diff2_horizontal" },
merge_tool = { layout = "diff3_horizontal" },
},
file_panel = {
listing_style = "tree",
win_config = { position = "left", width = 35 }, -- Use "auto" to fit content
},
hooks = {}, -- See :h diffview-config-hooks
keymaps = {}, -- See :h diffview-config-keymaps
})For the full list of options with defaults, see doc/diffview_defaults.txt or run :h diffview.defaults in Neovim.
See RECIPES.md for ready-to-use configuration snippets covering PR review, merge conflicts, file history, and more.
See TIPS.md for setup details and known compatibility issues.
See TIPS.md for common usage patterns, revision argument guide, LSP diagnostics in diffs, platform notes, and plugin compatibility.
| Resource | Description |
|---|---|
| USAGE.md | PR review, stash inspection, committing guides |
| RECIPES.md | Configuration snippets and recommended keymaps |
| TIPS.md | Tips, FAQ, and known compatibility issues |
| :h diffview | Full plugin documentation |
| :h diffview.defaults | Complete default configuration |
| Back | FazBrowse Home | New Git URL |