For example, I want "while" to be blue, "for" to be green, how to do that? Beyond colors, can I make syntax bold or italic? Thank you so much in advance.
相关问题
- Symbol's function definition is void: declare-
- How can I set the SVN password with Emacs 23.1 bui
- Emacs shell: save commit message
- emacs bind key to the insertion of another
- Emacs - set mark on edit location
相关文章
- ess-rdired: I get this error “no ESS process is as
- Emacs/xterm color annoyance on Linux
- Pipe less to Emacs
- Capturing the output of “diff” with org-babel
- emacs terminal mode: how to copy and paste efficie
- How to permanently enable the hs-minor-mode in ema
- Pipe emacs shell output to a new buffer
- Following a link into a git-repo without lengthy d
The easiest way is to put the cursor into a string of the given colour and type M-x
set-face-foreground
Enter. Then just confirm the face name and specify the colour. To set the face to bold or italic, useset-face-font
in a similar way.You can save the settings into your
.emacs
file:Because
ALL
of the following keywords are defined withinpython.el
aspython-font-lock-keywords
, you would need to trump some of them with a different font face or hack the source for these same keywords to have different font faces:"and" "del" "from" "not" "while" "as" "elif" "global" "or" "with" "assert" "else" "if" "pass" "yield" "break" "except" "import" "class" "in" "raise" "continue" "finally" "is" "return" "def" "for" "lambda" "try" "print" "exec" "nonlocal" "self".
The following code is an example of how to trump
python-font-lock-keywords
for some of the keywords that have already been defined withinpython.el
-- in this example,while
is blue with bold; and,for
is green with bold and italics.python-font-lock-keywords
that are not trumped by specially defined font faces will default tofont-lock-keyword-face
-- I have included a sample modification of that face as well: