开发者

Emacs text-mode highlighting

开发者 https://www.devze.com 2022-12-10 04:07 出处:网络
Is there a way to get a w开发者_高级运维ord to be rendered with a different face in text mode?Check out `highlight-regexp\'. Just type in the word you want to change the face for (although it can be a

Is there a way to get a w开发者_高级运维ord to be rendered with a different face in text mode?


Check out `highlight-regexp'. Just type in the word you want to change the face for (although it can be any regular expression).

M-x highlight-regexp

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

Specifically you'll want to turn on font-lock-mode and then specify a list of keywords via font-lock-add-keywords.

0

精彩评论

暂无评论...
验证码 换一张
取 消