I am connecting through putty and i am using vim editor in putty and writing program in perl. I dont have any particular vimrc file.

My problem is that in vim comments are rendered in DARK BLUE on BLACK BACKGROUND.

How to change that comments into some light color in vim or change some settings in putty?


you can either

  • play around with
:set background=dark
:set background=light
  • or use another colorscheme:
:colorscheme tab
  • or change the coloring for a 'comment' in your current colorscheme with
:highlight Comment

(this shows you the current settings, change it via

:highlight Comment guibg=white

or to whatever color you want.


You can say the following in vim:

:set background=dark

This will set the syntax highlighting to bright colours. The opposite will set it to dark colours:

:set background=light

Instead of (or in addition to) changing the colors in vim (as suggested in the other answers), you can also configure PuTTY to use colors that are easier to distinguish. PuTTY's color settings are under "Window/Colours". You probably want to change "ANSI blue" and "ANSI blue bold" to be lighter/brighter.

The advantage is that this will affect display in all programs that use color (such as ls --color or grep --color) and for all systems you log into.


See /usr/share/vim/vim61/colors/README.txt where /usr/share/vim/vim61/ is your vim directory. /usr/share/vim/vim61/colors/ holds all themes and configures the highlighting colors used.


You can try to edit the c.vim / cpp.vim file There is a variety of statement like:

  hi Comment       gui=NONE guifg=#0000ff

just change #0000ff to e.g. #999999 (a slightly dark gray)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.