Comparing two files in Vim
Is it possible to view two files side-by-side in Vim? If so, how can I set up my editor to do this, and is there a way to
diffbetween the two files within Vim?
I am aware of the
:prevcommands, but this is not what I'm after. It would really be nice to view the two files in tandem.
Open the side by side view:
Change between them:
Ctrl+w h or l
Checkout the vimdiff command, part of the vim package, if you want a diff-like view:
vimdiff file1.txt file2.txt
Yes, check out http://vimdoc.sourceforge.net/htmldoc/options.html#%27scrollbind%27 - with vimdiff it is the default.