How do I open a split window that spans the full width or height of the editor instead of splitting only the current window?
Answer
:botright split
Explanation
When you split a window with :split or :vsplit, Vim subdivides only the current window. Prefixing with :botright or :topleft tells Vim to open the new window at the absolute edge of the screen, spanning all existing rows or columns. This is especially useful for terminals, quickfix lists, or reference files you want to keep at a consistent size.
How it works
:botright split {file}— horizontal split at the bottom, full screen width:topleft split {file}— horizontal split at the top, full screen width:botright vsplit {file}— vertical split on the right, full screen height:topleft vsplit {file}— vertical split on the left, full screen height- These modifiers work with any
:split-family command::new,:vnew,:terminal,:copen, etc.
Example
Open a terminal at the bottom of the screen regardless of how many horizontal or vertical splits exist:
:botright 15split term://zsh
Open the quickfix window spanning the full width:
:botright copen
Tips
- Combine with a size:
:botright 10splitcreates a 10-line-high bottom pane :vertical topleft splitcan be abbreviated to:vert topleft sp- To always open
:copenfull-width, addautocmd QuickFixCmdPost * botright copento your vimrc <C-w>Jmoves the current window to occupy the full bottom row after the fact