开发者

No syntax highlighting after session restore in terminal

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开发者_JAVA百科 do I get this to work?

You can take a look at my .vimrc file at https://github.com/MaxSt/dotvim/blob/master/vimrc.


I have the same question here. You need add these settings on your .vimrc

filetype on

filetype plugin on

filetype indent on

syntax on

To enable your highlight color.

I was using my .vimrc which does not have these but works in linux and old mac version. For lion you need add them.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜