3

For example when I select a word I want the same words to be automatically highlighted just like it in Notepad++:

When I select the word "install" in Notepad++ (all other "install" are highlighted"):

enter image description here

I'm using spacemacs. I tried the package auto-highlight-symbol and also the package highlight-symbol. Set mode to 1 in .spacemacs. But when I select a word no other same words highlighted:

  • auto-highlight-symbol work for me, but I'm not sure about spacemacs. Is the face (color) too close to background? – xuhdev Nov 14 '16 at 10:19
  • 3
    Please clarify what you mean when you say "syntaxes": do you mean particular words or symbols? Please also clarify what you mean by "none of them are working." Edit you post to explain what, exactly, you did, what you expected, and what happened instead. – Dan Nov 15 '16 at 18:42

3 Answers3

1

Use package highlight-symbol.

(use-package highlight-symbol
  :ensure t
  :init
  (add-hook 'prog-mode-hook 'highlight-symbol-mode))
stardiviner
  • 1,888
  • 26
  • 45
  • This is nice and neat and in order to also easily navigate through highlighted you may look here: https://emacs.stackexchange.com/questions/12530/enable-highlighting-symbols-in-prog-mode – StefanQ Sep 27 '22 at 05:53
0

There are multiple packages that do this:

They all perform the basics well enough.

Although idle-highlight was the only package that worked well on large buffers.

ideasman42
  • 8,375
  • 1
  • 28
  • 105
0

You don't need to use any external package. Take a look at the functions isearch-forward-symbol-at-point and isearch-forward-symbol.

To find out if they're bound to a key on Spacemacs, evaluate (where-is 'isearch-forward-symbol).

aadcg
  • 1,203
  • 6
  • 13