How to highlight all occurrences of a word in an Emacs buffer?

后端 未结 13 1018
执念已碎
执念已碎 2020-12-12 11:56

Notepad++ has a convenient feature: if you select a word in your text (not necessarily a keyword), the word is highlighted throughout the text. Can this be done in Emacs as

相关标签:
13条回答
  • 2020-12-12 12:42

    The hi-lock suggestions are good. I think it's easier to use the M-x versions, though:

    M-x highlight-regexp RET <REGEXP>

    M-x highlight-phrase RET <REGEXP>

    highlight-phrase is just a bit of sugar around highlight-regexp that ignores case and translates a space in the regex to match arbitrary whitespace. Handy.

    0 讨论(0)
提交回复
热议问题