Last Updated: June 24, 2016
· 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>


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