Side-by-side editing of files in VIM

It you want to edit two files side-by-side in vi/vim then you can do it by using the -O option, as in this example:

# vim -O foo.txt bar.txt

I could never remember the option needed so thought I should note it here.

By the way, when you have finished, use :qa to quit all files being edited. If you just use :q you will have to type it to close each file. Also, use Ctrl+W, Ctrl+W to switch between the open files.

1 thought on “Side-by-side editing of files in VIM

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.