Skip to content

Instantly share code, notes, and snippets.

@chesster
Last active August 29, 2015 14:09
Show Gist options
  • Save chesster/99473ab05d461429677f to your computer and use it in GitHub Desktop.
Save chesster/99473ab05d461429677f to your computer and use it in GitHub Desktop.
Vim: Zoom / Restore window
" Zoom / Restore window.
function! s:ZoomToggle() abort
if exists('t:zoomed') && t:zoomed
execute t:zoom_winrestcmd
let t:zoomed = 0
else
let t:zoom_winrestcmd = winrestcmd()
resize
vertical resize
let t:zoomed = 1
endif
endfunction
command! ZoomToggle call s:ZoomToggle()
nnoremap <silent> <C-z> :ZoomToggle<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment