Yaming He
Yaming He

Reputation: 1

macvim c++ syntax highlight doesn't match .vimrc

I am using macvim 7.3 snapshot 66 on os x 10.8.2

I have following in my ~/.vimrc ( there is no ~/.gvimrc file )

syntax on
hi Comment guifg=darkred gui=none
hi PreProc guifg=darkgoldenrod
hi Type guifg=darkgreen gui=none
hi Constant guifg=darkmagenta
hi Statement guifg=darkblue gui=none

However when I using mvim editing h/cpp file, the comments are blue, and other color are not matching my setting as well? What could be the reason?

Upvotes: 0

Views: 563

Answers (1)

Nikita Kouevda
Nikita Kouevda

Reputation: 5746

You can execute :scriptnames to see which scripts, and in what order (most recent at the bottom), Vim sourced for the current buffer. You can also use :verbose highlight Comment to check where a particular highlight group was last set.

Unless you're using a different color scheme, you'll probably find one of the last lines in the output of :scriptnames to be $VIMRUNTIME/colors/macvim.vim, the default color scheme for MacVim. Color schemes, including the default one, supersede .vimrc and thus override any settings in it.

If you're entirely dissatisfied with your current color scheme, try to find another one. If you're generally content with it but you want to modify the highlighting for a specific filetype, consider using the ~/.vim/after/syntax directory. See :help mysyntaxfile-add for more information.

Upvotes: 2

Related Questions