Often, during the development, you'll find yourself needing to compare some files—be it comparing different output or versions of a file, or dealing with merge conflicts. Vim provides vimdiff, a standalone binary that excels at file comparison operations.
Resolving conflicts with vimdiff
Comparing two files
Using vimdiff to compare two files is fairly simple. Let's look at two files in animal_farm/ : animals/cat.py and animals/dog.py. We'd like to know what's different between the two.
The files from this example are available from https://github.com/PacktPublishing/Mastering-Vim/tree/master/Chapter05/animal_farm.
Open the files with vimdiff:
$ vimdiff animals/cat.py animals/dog.py
You will...