randomfox (randomfox) wrote,
randomfox
randomfox

Vim: Maximize/unmaximize the window vertically

This Vim macro toggles between a full-height window and a regular window.


" Maximize/unmaximize vertically.
function! Toggle_full_height()
    if exists("g:orig_height")
	execute 'set lines=' . g:orig_height
	unlet g:orig_height
    else
	let g:orig_height=&lines
	set lines=999
    endif
endfunction

" F9 toggles full height mode
nmap <F9> :call Toggle_full_height()<cr>
vmap <F9> <esc>:call Toggle_full_height()<cr>
imap <F9> <esc>:call Toggle_full_height()<cr>

Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments