change default comment color in vim

change default comment color in vim

Submitted by Jitesh Doshi on Tue, 04/09/2013 - 15:56
dark blue text unreadable in black background
green text readable in black background

On Debian systems (and perhaps on other linux distros as well), the foreground color of comments is blue by default. This looks quite unreadable on black background, which is the case for most terminal windows.

dark blue text  unreadable in black background

As you can see, the above is quite unreadable. But the fix is quite simple. Let's say you want to make all comments show in 'green' instead. Just add the following line to your ~/.vimrc (or /etc/vim/vimrc.local if you want to change it for everyone on your linux box).

highlight Comment ctermfg=green

Now the colors look far more readable. See below.

green text readable in black background

Jitesh Doshi

Profile picture for user Jitesh Doshi
Managing Partner & CTO
  • A seasoned technology entrepreneur and enthusiast
  • A regular speaker at industry conferences and universities
  • Host and organizer of technology user groups
  • Active in management of non-profit organizations serving the local community
  • Leader and contributor for multiple open-source projects
  • Expert in cloud, application integration, web and mobile technologies
  • Author of open-source projects, including on Drupal.org - Popular Tags and PRLP.
  • Developed several highly successful software platforms and frameworks for clients
© 2023 SpinSpire All rights reserved.