1

I want to compare two files(say A and B) side by side(vertically) in in Vim. I open one of those two files(say A) and as per this answer in this site issue a Ctrl+w v . Now both the panels are showing contents of file A. How can I see the contents of A in the left had side and B in the right hand side ? I am using Red Hat Linux if that matters .

Geek
  • 6,688

2 Answers2

4

You can skip Ctrl+w v and just do:

:vert diffsplit <other_filename>
otokan
  • 1,718
1

You must switch panes in vim and then open a new file.

Switch panes with CTRL+W+W.

Once the cursor is in the new pane, open a new file by entering the vim command line and using the open file command.

:e /some/file/name
George M
  • 13,959