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
LuaNOASSERTIONCreated 2021-05-01
+0
日增长
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

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON