Created
July 24, 2009 09:15
-
-
Save iain/153928 to your computer and use it in GitHub Desktop.
A piece of vimrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Save session and close vim by pressing SQ. | |
" When you open vim again, without arguments, it opens the saved session. | |
nmap SQ <ESC>:mksession! ~/.vim/Session.vim<CR>:wqa<CR> | |
function! RestoreSession() | |
if argc() == 0 "vim called without arguments | |
execute 'source ~/.vim/Session.vim' | |
end | |
endfunction | |
autocmd VimEnter * call RestoreSession() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment