O'Reilly logo

Mastering Vim by Ruslan Osipov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 move to previous line you can follow this section with any similar but somewhat different files.

Open the files with vimdiff:

$ vimdiff animals/cat.py animals/dog.py

You will be greeted to the following screen (how colorful the screen is will depend on your colorscheme):

You can see animals/cat.py open in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required