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've installed Ubuntu,

And they have decided to use blue text for comments in vim, Blue is the worst color to use for text, as human eyes have the least number of receptors for blue, one thing I remember from college.

Is it possible to tell vim never use blue? I don't want to install a new color theme or anything, because I like the syntax coloring they have for every thing, I can even see correct syntax in Apache's httpd.conf

So I need a simple change, blue to gray or something.

share|improve this question
up vote 6 down vote accepted

Append this line to your ~/.vimrc file:

hi Comment ctermfg=DarkRed

You can find the list of available colornames in the help section: :help cterm-colors.

share|improve this answer

Reconfigure your terminal instead. Under Edit → Profile Preferences → Colors, you can edit the palette used.

Note however that this only works for 16-color mode. In 256-color mode, such a task is impossible, since neither Vim nor the terminal have any way of knowing which colors are to be considered "blue" or "not blue" or in-between...

share|improve this answer
Thanks, but I'm sshing into the server it's not an xwindow – user893730 Mar 4 '12 at 3:32
@user893730, that means its more like the 16-color mode @grawity has mentioned. You've to tweak the terminal emulator preferences. Which could be : Settings for gnome-terminal or konsole or putty (if you ssh from windows) or xterm/rxvt/aterm (these, by setting colors resources in .Xdefaults file) and many more. – Anil Mar 4 '12 at 6:18
@Anil: 256-color mode is not related to X11 or SSH at all. It is a terminal emulator function, available on all platforms (for example, PuTTY on Windows). – grawity Mar 4 '12 at 10:37

Type :highlight to see a list of all colors and then change the ones that are blue with highlight NAME ctermfg=COLOR (put it in ~/.vimrc). For graphical vim you would use highlight NAME guifg=COLOR instead.

share|improve this answer

You must log in to answer this question.

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