How do I keep a utility split from resizing when other windows open or close?
Answer
:setlocal winfixheight winfixwidth
Explanation
If you use a dedicated utility pane (logs, quick notes, REPL output), Vim's default equalization behavior can keep resizing it whenever other splits change. Setting winfixheight and winfixwidth on that one window pins its dimensions so your main editing layout can change without disturbing the utility pane. This is especially useful in workflows that frequently open transient windows.
How it works
:setlocalapplies options only to the current windowwinfixheightasks Vim to avoid changing this window's height during layout operationswinfixwidthdoes the same for width- Using both gives predictable geometry for sidebars, terminals, or scratch panes
Example
Imagine a right-side notes split that should stay 40 columns wide while you open and close file previews on the left. In the notes window, run:
:setlocal winfixheight winfixwidth
Now when new splits appear, Vim prefers resizing other windows first, preserving that notes pane shape.
Tips
- Set these only on windows that truly need fixed dimensions
- Remove with
:setlocal nowinfixheight nowinfixwidthwhen you want normal resizing back - Pair with
:vert resize {N}or:resize {N}once, then lock the window