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:

2
  • auto-highlight-symbol work for me, but I'm not sure about spacemacs. Is the face (color) too close to background?
    – xuhdev
    Commented Nov 14, 2016 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
    Commented Nov 15, 2016 at 18:42

3 Answers 3

1

Use package highlight-symbol.

(use-package highlight-symbol
  :ensure t
  :init
  (add-hook 'prog-mode-hook 'highlight-symbol-mode))
1
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.

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).

2
  • Can this be done without moving the cursor?
    – ideasman42
    Commented Sep 16, 2021 at 14:23
  • @ideasman42 yes.
    – aadcg
    Commented Sep 16, 2021 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.