vim - file comparison

File comparison with Vim

Comparing two files in Vim

Try these out and add some more pointers to this file. Never tried these out before.

Option 1:

Open the file side by side view: Ctrl+w v

Change between them: Ctrl+w h or l

Checkout the vimdiff command, part of the vim package, if you want a diff-like view: (from terminal) vimdiff file1.txt file2.txt

Option 2:

Or just open the first file in Vim. Then :vert diffsplit ./file2 (if file2 is in the same folder as file1) (or) :vert diffsplit file2

:vert makes it split the screen vertically. diffsplit does a diff, and splits the files and scrolls locks them.