explaingit

sindrets/diffview.nvim

5,560LuaAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

A Neovim plugin that shows all your git changes in one place, browse modified files, view commit history, and resolve merge conflicts without leaving your editor.

Mindmap

mindmap
  root((diffview.nvim))
    What it does
      Git diff viewer
      File history browser
      Merge conflict tool
    Views
      Diff view all changes
      File history log
      Three-way merge
    Navigation
      Tab through files
      Filter by author
      Line-range history
    Requirements
      Neovim 0.7+
      Recent Git
    Install
      Any plugin manager
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Review all changed files before a commit by stepping through them one by one with a single keyboard shortcut.

USE CASE 2

Browse the full commit history for a specific file and open any past change to see exactly what was modified.

USE CASE 3

Resolve git merge conflicts in a three-way side-by-side view, accepting one side or combining both from inside Neovim.

USE CASE 4

Compare any two git commits or branches to see what changed between them.

Tech stack

LuaNeovim

Getting it running

Difficulty · easy Time to first run · 5min

Requires Neovim 0.7+ and a recent Git version, install via any Neovim plugin manager.

In plain English

Diffview.nvim is a plugin for Neovim, the terminal-based text editor, that makes reviewing git changes easier. When you have modified files in a project, opening the plugin brings up a single view that lists every changed file and lets you step through each one to see what changed, line by line. Without a tool like this, checking changes across many files requires opening each one separately in a split-screen comparison. The plugin adds two main views. The diff view shows all files changed relative to any git revision you specify. You can compare the current working state against the most recent commit, or compare any two historical commits by passing a range like a commit hash or a branch name. A tab and shift-tab let you cycle through the changed files one by one without closing and reopening the view. The file history view works as an interface to the git log command. You can open it for a specific file, a directory, or the whole project, and it lists every commit that touched those paths. From there you can open any commit to see what changed. The view also supports filtering by commit message or author, and can trace how a specific range of lines in a file changed across multiple commits. The merge tool activates automatically when you open the plugin during a git merge or rebase. Conflicted files appear in a three-way comparison showing your version, the incoming version, and the common ancestor. Keyboard shortcuts let you accept one side, the other, or a combination, and jump between conflict markers. The plugin requires Neovim version 0.7 or later and a recent version of Git. It is installed through any standard Neovim plugin manager.

Copy-paste prompts

Prompt 1
Show me how to install diffview.nvim with lazy.nvim and open it to review all my uncommitted changes.
Prompt 2
How do I use diffview.nvim to compare two git branches side by side and step through each changed file?
Prompt 3
Walk me through resolving a merge conflict in diffview.nvim, how do I open the three-way merge view and accept changes from one side?
Prompt 4
How do I open the file history view for a single file in diffview.nvim and jump to a specific commit to see what changed?
Open on GitHub → Explain another repo

← sindrets on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.