w1ng
w1ng

Reputation: 324

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 do I get this to work?

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

Upvotes: 3

Views: 1169

Answers (1)

Sammi Song
Sammi Song

Reputation: 36

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.

Upvotes: 2

Related Questions