Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the color of Emacs comments in C++/C mode to light pink

Tags:

emacs

While in C++/C mode, Emacs 23 colors source code comments in bold red. Strings literals are colored in light pink.

I would like to switch these colors (comments in light pink and string literals in red) because I find the comments become an eye-sore in heavily commented programs..

How do I do this? I don't want to install a new color scheme since I am already very happy with the default one in other respects.

like image 289
smilingbuddha Avatar asked Jan 04 '12 19:01

smilingbuddha


2 Answers

Put this in your .emacs file:

(set-face-foreground 'font-lock-string-face "red")
(set-face-foreground 'font-lock-comment-face "light pink")
like image 184
Asher L. Avatar answered Sep 23 '22 19:09

Asher L.


To do this interactively, place your point on a comment or string and run M-x customize-face and select the color you'd like.

like image 15
ataylor Avatar answered Sep 26 '22 19:09

ataylor