I've been using emacs 24 (built from the git version). I've started to create a custom theme, but I've noticed that the theming abilities are rather limited, particularly for Python.
I want to be able to assign different colors to things like
Highlighting of doctests. So if I have something like
def myfunc(x):
"""
This is the docstring.
>>> # These are the examples
>>> print myfunc(x)
1
"""
return 1
I want the This is the docstring
to be colored like the string, but I want the print myfunc()
to be colored like Python code (or at least differently). For example, in vim, using whatever plugin I have installed, the doctests are colored brown but the strings are colored blue.
Highlighting docstrings differently than regular strings.
"%s"
or "%(newstyle_formatting)s"
).Any suggestions for one or all of these?
I might add more things here if I think of them.
Take a look at the description of the variable font-lock-keywords
. It is possible to add rules based on regexp:s, but also based on functions so you can write code to decide what should be colored and in which color.
Also, you can use font-lock-add-keywords
to add fontification rules to major modes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With