How do I keep a split at a fixed width when opening and closing other windows?
Answer
:setlocal winfixwidth
Explanation
When you use a sidebar-style split for file trees, docs, or logs, automatic window equalization can constantly resize it. That visual jitter makes navigation slower and wastes attention. :setlocal winfixwidth keeps the current window's width stable while other windows change around it.
This is most useful in multi-split layouts where one narrow pane should stay predictable and your main editing area should absorb size changes.
How it works
:setlocalapplies the setting only to the current window'winfixwidth'tells Vim/Neovim not to change this window's width during automatic layout adjustments- Other windows can still be resized normally
Example
Left split: docs/help pane (30 columns)
Right split: code editor
Enable :setlocal winfixwidth in the left pane. Now opening quickfix, help, or temporary splits tends to resize the main editing pane first, while the sidebar width remains stable.
Tips
- Pair with
:vertical resize 30to set the initial width precisely - Disable later with
:setlocal nowinfixwidth - For horizontal stability, use
'winfixheight'on short utility panes