I've got four files
a b c d and would like to open them all in vim such that I have two tabs each vertically splitted into two windows; files
b in the first tab and
d in the second tab. Can I do this from command line?
I know there are
-O parameters, but they don't seem to cooperate. One only overwrites another from what I observed...
This command does what you want:
$ vim -c "edit a|split b|tabedit c|split d"
or, with shortened commands:
$ vim -c "e a|sp b|tabe c|sp d"
You should be able to open your files vertically splitted like this:
vim -O fileA.txt fileB.txt
vim -O fileC.txt fileD.txt
There are also some keys you can use for splitting.
Ctrl-W s for horizontal splitting
Ctrl-W v for vertical splitting
Ctrl-W q to close one
But you should know that different Vim instances have independent sessions.
Currently vim does not support to have seperate toplevel’ windows for the same process/session. It's on the ToDo list. (See
:help todo and search for "top-level".)
Perhaps the following will brings you further, if you need to share the same buffer between multiple instances of vim: gnu screen - Working with vim on multiple monitors