1 " auto sv and ld session
2 let g:AutoSessionFile="project.vim"
3 let g:OrigPWD=getcwd()
4 if filereadable(g:AutoSessionFile)
5 if argc() == 0
6 au VimEnter * call EnterHandler()
7 au VimLeave * call LeaveHandler()
8 endif
9 endif
10 function! LeaveHandler()
11 exec "mks! ".g:OrigPWD."/".g:AutoSessionFile
12 endfunction
13 function! EnterHandler()
14 exe "source ".g:AutoSessionFile
15 endfunction