Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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


:hi PreProc NONE

For Ruby do end, try either:

:hi link rubyControl NONE


: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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .