简体   繁体   English

Emacs文本模式突出显示

[英]Emacs text-mode highlighting

有没有办法让一个单词在文本模式下以另一张面孔呈现?

Check out `highlight-regexp'. 查看`highlight-regexp'。 Just type in the word you want to change the face for (although it can be any regular expression). 只需输入您要更改其名称的单词即可(尽管它可以是任何正则表达式)。

Mx highlight-regexp Mx高亮正则表达式

highlight-regexp is an alias for `hi-lock-face-buffer' in
`hi-lock.el'.

It is bound to M-s h r.

(highlight-regexp regexp &optional face)

Set face of each match of regexp to face.

Interactively, prompt for regexp then face.  Buffer-local history
list maintained for regexps, global history maintained for faces.
Use M-p to retrieve previous history items,
and M-n to retrieve default values.

Yes, 是,

What you want is font-lock-mode. 您想要的是字体锁定模式。

See here: http://www.gnu.org/software/emacs/manual/html_node/emacs/Font-Lock.html 参见此处: http : //www.gnu.org/software/emacs/manual/html_node/emacs/Font-Lock.html

Specifically you'll want to turn on font-lock-mode and then specify a list of keywords via font-lock-add-keywords . 具体来说,您需要打开font-lock-mode ,然后通过font-lock-add-keywords指定关键字列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM