Viewing all `git diffs` with vimdiff Viewing all `git diffs` with vimdiff git git

Viewing all `git diffs` with vimdiff


git config --global diff.tool vimdiffgit config --global difftool.prompt false

Typing git difftool yields the expected behavior.

Navigation commands,

  • :qa in vim cycles to the next file in the changeset without saving anything.

Aliasing (example)

git config --global alias.d difftool

.. will let you type git d to invoke vimdiff.

Advanced use-cases,

  • By default, git calls vimdiff with the -R option. You can override it with git config --global difftool.vimdiff.cmd 'vimdiff "$LOCAL" "$REMOTE"'. That will open vimdiff in writeable mode which allows edits while diffing.
  • :wq in vim cycles to the next file in the changeset with changes saved.


You can try git difftool, it is designed to do this stuff.

First, you need to config diff tool to vimdiff

git config diff.tool vimdiff

Then, when you want to diff, just use git difftool instead of git diff. It will work as you expect.


Git accepts kdiff3, tkdiff, meld, xxdiff, emerge, vimdiff, gvimdiff, ecmerge,and opendiff as valid diff tools. You can also set up a custom tool. git config --global diff.tool vimdiffgit config --global diff.tool kdiff3git config --global diff.tool meldgit config --global diff.tool xxdiffgit config --global diff.tool emergegit config --global diff.tool gvimdiffgit config --global diff.tool ecmerge