Last Updated: June 24, 2016
·
1.85K
· ryrych

Vim panes resizing

You can maximize panes

  • Horizontally with <kbd>Ctrl w |</kbd>
  • Vertically with <kbd>Ctrl w _</kbd>

To make all panes equal type <kbd>Ctrl w =</kbd>. As resizing is a frequent
action, you can consider following mappings:

nnoremap <silent><Leader>+ :exe "resize " . (winheight(0) * 3/2)<CR>
nnoremap <silent><Leader>- :exe "resize " . (winheight(0) * 2/3)<CR>
nnoremap <silent><Leader>> :exe "vertical resize " . (winwidth(0) * 3/2)<CR>
nnoremap <silent><Leader>< :exe "vertical resize " . (winwidth(0) * 2/3)<CR>

[Source][1]

For maximizing and restoring the current window I suggest you trying [vim-maximizer][2] which toggles the current pane size with <kbd>F3</kbd>.

[1]: https://github.com/ryrych/dotfiles/blob/138deba04f00cc8782e2ce847b8af83d3b00855c/vimrc#L113-L116
[2]: https://github.com/szw/vim-maximizer