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

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.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)