Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I really like my current vim color scheme (/colors/desert.vim).

The syntax highlighting is great except for the color of certain keywords. For example, in ruby files (.rb), I dislike how it highlights def and end. In java files (.java), it's the import keyword.

The color is a dark purple that clashes against my background.

How do I change this color? I can edit the desert.vim file, but am having trouble finding the color.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You can see the full list of things that are highlighted by typing :hi (short for highlight).

You can also look in /usr/share/vim/vimcurrent/syntax/<filetype>.vim, e.g. /usr/share/vim/vimcurrent/syntax/ruby.vim, or your computer's equivalent.

For Java includes, try either:

:hi link Include NONE

or

:hi PreProc NONE

For Ruby do end, try either:

:hi link rubyControl NONE

or

:hi Statement NONE

You can put whichever one works in your ~/.vimrc to make it persistent.

If you want to change the color to something else, see the :highlight documentation for more details.

share|improve this answer
    
For persistence, I'd rather suggest putting custom language-specific highlight colors in ~/.vim/after/syntax/ruby.vim . This will leave the default color scheme unchanged and will keep ~/.vimrc minimal, holding only general settings. –  vtest Apr 5 '11 at 12:53
    
The line ended up being: hi PreProc ctermfg=5 (and all other places with ctermfg=5), which I changed to ctermfg=7. –  dsg Apr 5 '11 at 18:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.