vimdiff

Table of Content

Keybindings

KeybindDescription
ctrl+w (h/j/k/l)switch windows
dodiff obtain
dpdiff put
[cprevious difference
]cnext difference
:diffupdatediff update ;)
:syntax offsyntax off
zoopen folded text
zcclose folded text

Compare output of commands

To compare the output of commands, you have to place them between <(...) which leads you to a command like this:

$ vimdiff <(grep result1 ~/mytestfile1) <(grep result2 ~/mytestfile2)

Alternatives

  • diff: Allows you to display diffs in your terminal and can also create patches
  • git: Yes, also with git you can perform diffs using the command git diff --no-index [path/file/1] [path/file/2]