Created
March 12, 2013 15:17
-
-
Save kogakure/5143767 to your computer and use it in GitHub Desktop.
Vim: Easy Vim session management
This file contains hidden or 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
| " http://connermcd.com/blog/2013/03/11/easy-vim-session-management/ | |
| " | |
| " Make a session: :Mks | |
| " Load a session: source my-session-file.session | |
| command! Mks let g:session = getcwd() <bar> call Mks(g:session) | |
| augroup vimrc | |
| au! | |
| au BufRead *.session let g:session = expand('%:p:h') | so % | bd # | |
| au VimLeave * if exists('g:session') | call Mks(g:session) | endif | |
| augroup end | |
| fun! Mks(path) | |
| exe "mksession! ".a:path."/".fnamemodify(a:path, ':t').".session" | |
| endfun |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment