nschum / highlight-symbol.el

Emacs: automatic and manual symbol highlighting
http://nschum.de/src/emacs/highlight-symbol/
274 stars 41 forks source link

Is it possible to highlight selection #49

Open ChoppinBlockParty opened 6 years ago

ChoppinBlockParty commented 6 years ago

I wonder if there is an option to highlight selection. I think that would be super helpful. I am using evil, is it possible to highlight pattern selected in visual mode?

lynnux commented 3 years ago

try this:

(defadvice highlight-symbol-get-symbol (around my-highlight-symbol-get-symbol activate)
  (if (use-region-p)
      (setq ad-return-value (buffer-substring (region-beginning) (region-end)))
    ad-do-it
    )
  )
SadSock commented 2 years ago

try this:

(defadvice highlight-symbol-get-symbol (around my-highlight-symbol-get-symbol activate)
  (if (use-region-p)
      (setq ad-return-value (buffer-substring (region-beginning) (region-end)))
    ad-do-it
    )
  )

it does not work in spacemacs. I don't know why.