When I open a new buffer I usually just do :vsp something
which allows me to open a new buffer with a vertical split. However, when I don't control how the buffer should be opened (e.g. when typing :help
) the new buffer is always opened with a horizontal split, which really annoys me. Is there anyway to change the default split direction?
Add a comment
|
2 Answers
Vim provides :vert
to split vertically.
There isn't any option to change the default horizontal split but you can add :vert
before file to open it
like :vert help
:vert[ical] {cmd}
Execute {cmd}. If it contains a command that splits a window,
it will be split vertically.
@Ashok's answer is good but if you do this often you may want to use cabbrev
to do it for you.
Add this to your .vimrc
to have vim automatically put in :vert help
whenever you type :help
cabbrev help vert help
-
2Only problem with this is that OP only gave help as an example. There are lots of other cases that could open a split that this won't catch. :/ Commented Jan 12, 2017 at 23:50
-
@Tumbler41 it's not a perfect solution but that's why I wrote "if you do this often"– laktakCommented Jan 13, 2017 at 9:15
-
how can i position the buffer to the
last position
(far right), automatically? Commented Jun 9, 2021 at 11:09