RRethy / vim-illuminate

illuminate.vim - (Neo)Vim plugin for automatically highlighting other uses of the word under the cursor using either LSP, Tree-sitter, or regex matching.
2.12k stars 44 forks source link

Feature request: Can I configure the plugin to highlight other occurences of current selection when in visual or select mode? #196

Closed renauga closed 3 months ago

renauga commented 3 months ago

I want the plugin to work like this:

  1. When in visual mode, highlight the current selection - this can be disabled if there are too many occurences or the selection is too large.
  2. Otherwise, work as it currently does. How can I achieve this?
RRethy commented 3 months ago

You can use the should_enable = function(bufnr) return true end, field in the config. Just add your own logic to disable/enable.

renauga commented 3 months ago

But how do I change the string being illuminated? Currently, in visual mode, the reference under the cursor is illuminated, not the selection.

RRethy commented 3 months ago

You probably need a different plugin, vim-illuminate doesn't provide the functionality to highlight other occurrences of a visual selection.

renauga commented 3 months ago

I couldn't find a plugin for this. It looks a like a good feature to add to vim-illuminate. It's similar to the current use of the plugin and makes more sense in visual mode.