I'm using Mac Lion 10.7.1, MacVim Snapshot 61, Vim version 7.3
I want to save the session on quit and restore the last session on Vim start without any arguments.
So I added this code in my .vimrc
file:
autocmd VimEnter * call LoadSession()
autocmd VimLeave * call SaveSession()
function! SaveSession()
execute 'mksession! $HOME/.vim/sessions/session.vim'
endfunction
function! LoadSession()
if argc() == 0
execute 'source $HOME/.vim/sessions/session.vim'
endif
endfunction
this works great with MacVim, but when I open Vim in terminal syntax highlighting is not working. How do I get this to work?
You can take a look at my .vimrc
file at https://github.com/MaxSt/dotvim/blob/master/vimrc.