Using the vim split command from the command line to get 4 quater splits

Posted by sixtyfootersdude on Super User See other posts from Super User or by sixtyfootersdude
Published on 2010-02-25T16:55:08Z Indexed on 2011/11/18 17:54 UTC
Read the original article Hit count: 304

Filed under:
|

I want to open four vim files on the command line:

vim file1 file2 file3

But I would like each file to be opened in a separate split:

vim -c "split file1" -c "split file2" -c "split file3" file4

(The above splits the screen horizontally 4 times)

Ideally what I would like to do is split the screen into 4 squares like:

|-------|-------|
|       |       |
|       |       |
|-------|-------|
|       |       |
|       |       |
|-------|-------|

I know how to do this once vim is open but I am unable to do this from the command line (using vs). Any ideas? Everything I try ends up looking like this (or a different variation):

|-------|-------|
|       |       |
|-------|       |
|       |       |
|-------|       |
|       |       |
|       |       |
|-------|-------|

© Super User or respective owner

Related posts about vim

Related posts about split