Reply to message «syntax coloring», sent 11:06:33 15 April 2011, Friday by rameo:
> When I start VIM it shows my tabs and reloads my buffers from the last > time. > > I use a session to do this. > > au VimEnter * exe "so d:\\Session.vim" > au VimLeave * exe "'mksession! d:\\Session.vim'" You have made just the same mistake as me some time ago: all filetype-related files are loaded using an autocommand, but by default no autocommands are allowed when you are executing an autocommand, so you should add `nested' just after the pattern. By the way, why do you use `exe'? The following works as well: augroup SaveRestoreSessions autocmd! autocmd VimEnter * nested source D:\session.vim autocmd VimLeave * nested mksession! D:\session.vim augroup END See `:h autocmd-nested' for more details. Original message: > When I start VIM it shows my tabs and reloads my buffers from the last > time. > > I use a session to do this. > > au VimEnter * exe "so d:\\Session.vim" > au VimLeave * exe "'mksession! d:\\Session.vim'" > > My reopened files do not have syntax coloring. > I have to do ":e" in every file where I need syntax coloring to view > syntax coloring. > > I know that I can add "localoptions" in sessionoptions but this slows > down my vim (I noted that it uses 20-25% more CPU). Without > "localoptions" my vim is much faster. > > How do you resolve this? > Don't you use sessions?
signature.asc
Description: This is a digitally signed message part.