Using Neovim as Git Diff Tool

Published

2025-08-06

Modified

2026-07-21

Configuration

Add this to your .gitconfig:

# Using nvim as diff tool
[difftool]
    prompt = true
[diff]
    tool = nvimdiff
[difftool "nvimdiff"]
    cmd = "nvim -d \"$REMOTE\" \"$LOCAL\""

Usage

git difftool
git difftool HEAD~1
git difftool branch1..branch2

What This Does

Opens Neovim in diff mode with two panes

  • $REMOTE - will be displayed in the right pane
  • $LOCAL - will be displayed in the left pane
  • prompt = true - asks before opening each file
Back to top