I have list of buffers in vim. I can split buffer horizontally using :sb[N] where N is the buffer number. How can I split the buffer vertically ?
vsplit commands take a filename as an argument like
:vs somefile to open a file in a vertical split.
To put an existing buffer in a split window you use the
sb# command (where # is the buffer number). Splits in VIM default to horizontal, to change this, prefix your command with
vert which forces a vertical split of the next split command.
Where # is the buffer number
As kirysu said, but additionally with "positioning the other split".
:vert rightbelow sb otherfile.txt
:vert bel sb otherfile.txt
... opens a existing buffer, named
otherfile.txt, in a split "right below" the existing one.
In the case of vertical splitting, it means "right side of the existing buffer".
Here you can use the
[tab]-key too, to let vim complete the buffer-name!
:help :vert too, for further "positioning"-commands)