Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change font color for comments in vim

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. I'm using xfce4-terminal, not gvim with GUI.

How do I change only this one color?

So far, I have changed the settings in my ~/.profile file according to "256 colors in vim" using:

if [ -e /usr/share/terminfo/x/xterm-256color ]; then         export TERM='xterm-256color' else         export TERM='xterm-color' fi 

and

set t_Co=256 

in ~/.vimrc.

like image 331
xralf Avatar asked Apr 29 '11 09:04

xralf


People also ask

How do I change the comment color in vim?

You can change color schemes at anytime in vi by typing colorscheme followed by a space and the name of the color scheme. For more color schemes, you can browse this library on the vim website. You can enable or disable colors by simply typing "syntax on" or "syntax off" in vi.

How do you change the color of comments in PuTTY?

Click on the System menu at the upper left corner of the PuTTY window. Select Change Settings > Window > Colours. In the box that says "Select a colour to adjust", choose ANSI Blue and click the Modify Button.

How do I enable syntax highlighting in vim?

After opening login.sh file in vim editor, press ESC key and type ':syntax on' to enable syntax highlighting. The file will look like the following image if syntax highlighting is on. Press ESC key and type, “syntax off” to disable syntax highlighting.

Where are vim color schemes?

Vim color schemes are stored in vim directory named /usr/share/vim/vim80/colors/ but vim80 can be different according to vim version.


1 Answers

Most well-behaving colorschemes will respect the background setting.

set background=dark 

would change the color of comments from dark blue to light blue, when using the default colorscheme.

like image 110
mike3996 Avatar answered Sep 23 '22 15:09

mike3996