Zooming Vim Window Splits like a Pro

vinodkri
1 min readJan 24, 2018

--

Most of the time, having multiple splits in a window is necessary. But at times it's a distraction. There is also a need not to close all other splits in the window; so as, not to lose the context. Below is a neat trick to zoom-in and zoom-out the splits.

noremap Zz <c-w>_ \| <c-w>\|
noremap Zo <c-w>=

The command’s wont close any buffers like CTRL-W + o would.

Explanation of the commands:
CTRL-W + | Set current window width to N (default: widest possible).
CTRL-W + _ Set current window height to N (default: highest possible).
CTRL-W + = Make all windows (almost) equally high and wide.

Resource:
:help window-resize

Thank you for reading! Clap if you liked this post. Have any feedback/comments? Please leave them here!

--

--