Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Split vertically window at startup with .vimrc

Tags:

vim

As the title suggests, how to split the page vertically on startup with .vimrc?

like image 701
Filippo Alessi Avatar asked Sep 16 '12 14:09

Filippo Alessi


1 Answers

If you want a vertical split when vim starts up, add an autocommand to your .vimrc:

au VimEnter * vsplit

Note that vim will do this for you if you're opening multiple files on the command line: use the -O switch.

-o[N] Open N windows (default: one for each file)

-O[N] Like -o but split vertically

So you can start vim like this:

$ vim -O MyPage.html MyPage.css

And vim will open with those two files both visible in a vertical split.

like image 197
pb2q Avatar answered Oct 23 '22 21:10

pb2q