sindrets /diffview.nvim
Single tabpage interface for easily cycling through diffs for all modified files for any git rev.
★ 5,888⑂ 231👁 14⑃ 140● 481▤ 0
+0
Daily
5,888
stars
231
forks
14
watchers
140
prs
481
issues
0
releases
README
Diffview.nvim
Single tabpage interface for easily cycling through diffs for all modified files
for any git rev.
!preview
Introduction
Vim's diff mode is pretty good, but there is no convenient way to quickly bring
up all modified files in a diffsplit. This plugin aims to provide a simple,
unified, single tabpage interface that lets you easily review all changed files
for any git rev.
Requirements
- Git ≥ 2.31.0 (for Git support)
- Mercurial ≥ 5.4.0 (for Mercurial support)
- Neovim ≥ 0.7.0 (with LuaJIT)
- nvim-web-devicons (optional) For file icons
Installation
Install the plugin with your package manager of choice.
vim
" Plug
Plug 'sindrets/diffview.nvim'
lua
-- Packer
use "sindrets/diffview.nvim"
Merge Tool
!merge tool showcase
Opening a diff view during a merge or a rebase will list the conflicted files in
their own section. When opening a conflicted file, it will open in a 3-way diff
allowing you to resolve the merge conflicts with the context of the target
branch's version, as well as the version from the branch which is being merged.
The 3-way diff is only the default layout for merge conflicts. There are
multiple variations on this layout, a 4-way diff layout, and a single window
layout available.
In addition to the normal :h copy-diffs mappings, there are default mappings
provided for jumping between conflict markers, obtaining a hunk directly from
any of the diff buffers, and accepting any one, all, or none of the versions of
a file given by a conflict region.
For more information on the merge tool, mappings, layouts and how to
configure them, see:
- :h diffview-merge-tool
- :h diffview-config-view.x.layout
File History
!file history showcase
The file history view allows you to list all the commits that affected a given
set of paths, and view the changes made in a diff split. This is a porcelain
interface for git-log, and supports a good number of its options. Things like:
- Filtering commits by grepping commit messages and commit authors.
- Tracing the line evolution of a given set of line ranges for multiple files.
- Only listing changes for a specific commit range, branch, or tag.
- Following file changes through renames.
Get started by opening file history for:
- The current branch: :DiffviewFileHistory
- The current file: :DiffviewFileHistory %
For more info, see :h :DiffviewFileHistory.
Usage
:DiffviewOpen [git rev] [options] [ -- {paths...}]
Calling :DiffviewOpen with no args opens a new Diffview that compares against
the current index. You can also provide any valid git rev to view only changes
for that rev.
Examples:
- :DiffviewOpen
- :DiffviewOpen HEAD~2
- :DiffviewOpen HEAD~4..HEAD~2
- :DiffviewOpen d4a7b0d
- :DiffviewOpen d4a7b0d^!
- :DiffviewOpen d4a7b0d..519b30e
- :DiffviewOpen origin/main...HEAD
You can also provide additional paths to narrow down what files are shown:
- :DiffviewOpen HEAD~2 -- lua/diffview plugin
For information about additional [options], visit the
documentation.Top issues
#605Is this repo active ?15 comments · 2026-01-14#162Allow DiffviewOpen to switch to already opened diffview tab14 comments · 2022-06-21#351Highlights from `diff.vim` may not be loaded12 comments · 2023-04-28#279docs: Show example of Telescope integration11 comments · 2023-01-02#546How to setup diff view colorscheme like the one in the readme (the screenshot)?10 comments · 2024-12-09#39[feature] option for unified- / inline-diff10 comments · 2021-07-08#582[Bug] Tree expands on tab switch7 comments · 2025-06-25#509[Bug] Diffview flashes current window's open buffer when showing file diff or history7 comments · 2024-06-07