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.
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