Skip to content

Instantly share code, notes, and snippets.

@lukesh
Created November 30, 2010 17:53
Show Gist options
  • Save lukesh/722066 to your computer and use it in GitHub Desktop.
Save lukesh/722066 to your computer and use it in GitHub Desktop.
nnoremap <C-W>O :call MaximizeToggle ()<CR>
nnoremap <C-W>o :call MaximizeToggle ()<CR>
nnoremap <C-W><C-O> :call MaximizeToggle ()<CR>
function! MaximizeToggle()
if exists("s:maximize_session")
exec "source " . s:maximize_session
call delete(s:maximize_session)
unlet s:maximize_session
let &hidden=s:maximize_hidden_save
unlet s:maximize_hidden_save
else
let s:maximize_hidden_save = &hidden
let s:maximize_session = tempname()
set hidden
exec "mksession! " . s:maximize_session
only
endif
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment