How do I allow split windows to collapse completely to just their status line?
Answer
:set winminheight=0
Explanation
By default, Vim enforces a minimum window height of 1 line, which means you can never fully collapse a split. Setting winminheight=0 removes this floor, allowing windows to shrink all the way down to just their status line. This is particularly powerful when combined with <C-w>_ (maximize current window height) — you can effectively zoom into one window while keeping the others accessible as thin strips.
How it works
winminheightcontrols the minimum number of text lines each window must maintain- The default value is
1, preventing full collapse - Setting it to
0allows any window to be reduced to 0 text lines (only the status line remains visible) <C-w>_maximizes the current window to use all available height<C-w>=restores all windows to equal sizes
Example
Add to your vimrc:
set winminheight=0
Then open several splits:
:split file1.txt
:split file2.txt
:split file3.txt
Press <C-w>_ to maximize the current split. The other windows collapse to just their status lines, giving you maximum editing space. Navigate to another window with <C-w>j and press <C-w>_ again to zoom into it.
Tips
- Combine with
set winminwidth=0for the same behavior on vertical splits - Use
<C-w>=to restore equal sizing when done - A useful vimrc pattern pairs this with
<C-w>_mapped to a convenient key for quick zoom/unzoom - This setting does not affect the active window — only inactive ones can collapse