1

This question already has an answer here:

I have 2 buffers on eachother covering top and bottom of the screen.

I want ot open a third buffer on right split but the problem is is I make a right split it will only split the top right or bottom right because i have already a horizontal split.

So is there any way to make a vertical or horizontal split on the main level while we have other splits?

marked as duplicate by Mass, Herb Wolfe, statox Nov 13 '17 at 8:48

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4

There isn't one single builtin command to open the buffer and position it, I don't believe.

Well, it turns out there is. The :botright {cmd} style of commands (e.g. :botright vsplit). If @Mass provides an answer please accept that answer. I'll leave this for informational purposes as the Ctrl-W commands discussed at the end might still be of interest to some folks.


...create your own command with a mapping. For example:

nnoremap <leader>vr <C-W>v<C-W>l<C-W>L

I've chosen vr to stand for Vertical Right. It will open a vertical split to the right of the current buffer, move the cursor into it, then move the new buffer to the "far right" which will cause it to span the full height of the window.

In general, if you follow CtrlW with one of H, K, L, J it will move the current buffer to the far left/top/right/bottom, respectively, which means the buffer will fully span the window horizontally (if moved to far top/bottom) or vertically (far left/right).

  • 1
    uh, what about botright vsplit? – Mass Nov 9 '17 at 3:58
  • Uh, I didn't know about that. Why you talking to me rather than answering? ;) – B Layer Nov 9 '17 at 4:00
  • So far this is the only answer until @Mass creates an answer im accepting this one – nikoss Nov 9 '17 at 12:34

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