2

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.

1 Answer 1

2

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.

2
  • 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, 2011 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, 2011 at 18:47

You must log in to answer this question.

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