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?
Asked
Active
Viewed 1,267 times
9
tjespe
- 205
- 1
- 4
2 Answers
6
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 Arora
- 859
- 1
- 7
- 13
6
@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
laktak
- 2,933
- 13
- 27
last position(far right), automatically? – alexzander Jun 09 '21 at 11:09