I'd like to change the default font color for comments which is dark blue to slightly yellow color. It is difficult to read on the black background.
Could you advise me how to change only this one color? I'm satisfied with the other colors.

I'm using xfce4-terminal (not gvim with GUI).

So far, I have done the settings in ~/.profile file according to this link as follows

Just a stupid question, did you try the different builtin colorschemes? Try for example :colorscheme desert. Tab-completion should work usually.
– BenoitApr 29 '11 at 11:34

I tried it. But I'd like to achieve more customization. If nobody knows this answer, I will accept yours as the best solution, because you answered before I made my question more specific according to what I wanted to achieve.
– xralfApr 29 '11 at 12:50

Can't you reassign the color palette of the terminal? Doesn't the terminal have any settings?
– BenoitApr 29 '11 at 12:57

Thank you. ctermfg works with colors like green or yellow. But if I will give it #ABCDEF or ABCDEF it writes error E421: color name or number not recognized . It doesn't recognize letters in hexadecimal code, it recognizes only numbers.
– xralfApr 29 '11 at 9:20

yes, the guifg parameter is for when you use vim gui (gvim).
– BenoitApr 29 '11 at 9:24

1

That means that I'm restricted to only 16 colors? I added the setting to .vimrc but this doesn't work set highlight Comment ctermfg=yellow
– xralfApr 29 '11 at 9:33

1

There are more than 16. See here. I want to achieve that my comments are yellow but only slightly yellow and forever. Is it possible to set this in .vimrc?
– xralfApr 29 '11 at 9:49

2

This is two years too late, but in case anyone else is wanting the solution to @Roboprog 's problem. Mine was ignoring it when i put the line hi comment ctermfg=<colour> into the .vimrc file, but i worked out it was because that line came before the line syntax on, once i swapped the order, it worked fine..
– guskenny83Jun 23 '16 at 3:51

This is an awesome solution. Maybe not the best answer to the question above, but solved the "very difficult to read" proble ina perfect way.
– GabrieleVSep 9 '11 at 13:32

5

This should be the default on Ubuntu. Comments are basically impossible to read when dark blue on the purple background. Thanks. I included this in my ~/.vimrc file. If someone wants to test what this looks like without doing that, just type the above command into vim after pressing the : key.
– Drew NoakesJan 25 '13 at 22:14

1

That was the first thing a google search turned up. However, I like the default colors (other than comments) which work well both in the dark terminal window and when pasted into an email/doc with a white background. I like a dark terminal, what can I say? (nostalgia/custom)
– RoboprogApr 17 '13 at 23:32

2

adding the line 'set background=dark' to ~/.vimrc did the trick. my eyes got so use to the other colour scheme, my brain thinks this looks ugly... but at least i can see my comments now. Thanks.
– sonjzDec 10 '13 at 22:19

3

@3kstc: you can add it to your ~/.vimrc as-is. You can also preview what happens in the current session only by typing it in command mode. (In normal mode, type : to enter command mode.)
– souser12345Jan 8 '18 at 6:01

After a bit searching one can find a decent reference to vim, regarding this issue especially, over at http://vim.wikia.com/wiki/256_colors_in_vim. A decent place to get started though, is via:
be
:verbose hi
when actually inside vim, and editing a file. Then check out how all of the variables have had metadata associated with them. Data returned from there, make it real easy to add the desired modifier types into .vimrc. As an example, these are updates I recently added in order to get rid of dark blue, and not have to tormented by the light blue, as a consequence:

There are various colour schemes in vim. default colour scheme displays comment in blue colour which makes hard to read in black terminal background. I prefer to use desert colour scheme which displays in readable colours.

To enable desert colour scheme in vim, use the command :color desert. If you want to go back to default use the command :color default.