6

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?

4

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.
4

@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
  • 2
    Only 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. :/ – Tumbler41 Jan 12 '17 at 23:50
  • @Tumbler41 it's not a perfect solution but that's why I wrote "if you do this often" – laktak Jan 13 '17 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.