tags:

views:

1675

answers:

5

there must be vim -[option] file-list to open files in FROM COMMAND PROMPT and NOT from within VIM

  • split widows vertically or/and harizontally
  • in separate tabs

assume I am using vim 7.2

+1  A: 

While running vim:

  1. :sp filename (horizontal)
  2. :vsp filename (vertical)
Taylor Leese
+11  A: 

I'm assuming you mean from the command line. From vim --help:

-o[N]                Open N windows (default: one for each file)
-O[N]                Like -o but split vertically

So type this to open files split horizontally, for example:

vim -o3 file1.txt file2.txt file3.txt
Laurence Gonsalves
Really? I've never had to provide an N.
Jefromi
Indeed, it seems to be something in my .vimrc causing the trouble. If I move it aside, -o without N works as documented.
Laurence Gonsalves
+3  A: 

Ctrl-W s for horizontal splitting

Ctrl-W v for vertical splitting

Ctrl-w q to close one

LB
No! I am looking to open from the command prompt, and not within the vim
vehomzzz
before your edition, there was no way to understand that. Down-voting me seems a bit cavalier.
LB
+4  A: 

another interested trick is the CLI -p argument - which opens them in separate tabs for recent versions of vim and gvim.

gvim -p file1.txt file2.txt
dls
+1  A: 

This question is also asked on SuperUser, and shows how to do it and split horizontally and vertically at the same time!

http://superuser.com/questions/113411/using-the-vim-split-command-from-the-command-line-to-get-4-quater-splits

Brad Parks