Using Neovim as Git Diff Tool
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
Navigation
In Neovim diff mode:
-
]c
- jump to next change -
[c
- jump to previous change -
:diffget
- get change from other pane -
:diffput
- put change to other pane
Created: 2025-08-06
--
Updated: 2025-08-09