Skip to main content

The diff feature of vim lets show differences between two, three or four versions of the same file

The easiest way to start editing in diff mode is with the "vimdiff" command. This starts Vim as usual, and additionally sets up for viewing the differences between the arguments.

vimdiff file1 file2 [file3 [file4]]

This is equivalent to:

vim -d file1 file2 [file3 [file4]]

Source: vimdoc