Ask HN: How do I customize code coloring in emacs?
I program Django/Python in emacs, and I would like things like {% comment %} FOO {% endcomment %} to turn orange.
How can I set up some colors for important Django template tags?
If you can give me a bit of example code, that would be great. A link to an example of this would be great too.
8 comments
[ 2.5 ms ] story [ 30.5 ms ] threadTo change the color of a specific face in emacs, go to the face and do M-x set-face-foreground Return and put the color you want.
Choose one of the included themes that you like the most, and start customizing.
Personally, I like zenburn. http://www.brockman.se/software/zenburn/zenburn.el But that might be a bit heavy to start off with.
Or, the shortcut way, define some stuff in custom-set-faces. e.g.:
Of course, this all requires that your Django/Python mode has a face for the {% ... %} stuff. I've never done any Django work, so I'm not sure if it does. If it doesn't, you'll have to hack at the Django/Python mode some to define that face so you can color it.is my preference
I got this snippet, and I think I can take it from here: