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.19k stars 50 forks source link

Conflict with norcalli/nvim-colorizer.lua #76

Closed lcrockett closed 3 years ago

lcrockett commented 3 years ago

Describe the bug When using this plugin in conjunction with norcalli/nvim-colorizer.lua and having enabling nvim-colorizer, RGB codes that are under the cursor will lose their nvim-colorizer highlighting.

To Reproduce

  1. Install plugin nvim-colorizer
  2. Install plugin vim-illuminate
  3. Open a file that has multiple duplicate RGB codes written inside of it
  4. Enable nvim-colorizer
  5. Place cursor on a RGB code text (for instance #ff0000) that occurs multiple times in the file

Expected behavior It would be great if RGB codes can be excluded somehow. For instance via a plugin option or using regex pattern matching. I did play around with g:Illuminate_highlightPriority but was not able to modify this behaviour.

Screenshots image The cursor is on #00aa00 at the bottom, making illuminate highlighting the same occurrence at the top.

Additional context N/A

RRethy commented 3 years ago

Duplicate of https://github.com/RRethy/vim-illuminate/issues/46

lcrockett commented 3 years ago

Apologies for the duplicate, I did not realize vim-hexokinase existed. It's much more to my liking then nvim-colorizer and it solves my problem by using foregroundfull. Cheers !

RRethy commented 3 years ago

No worries, I think nvim-colorizer has a foreground mode you might also want to try. Both nvim-colorizer and vim-hexokinase are about equivalent.

lcrockett commented 3 years ago

Yep, it has a foreground option indeed, but in hindsight it doesn't seem to contrast well with backgrounds of similar colour. For now i'm going to use both plugins in tandem. nvim-colorizer to keep highlighting the background and vim-hexokinase with the virtual text highlighting (neat feature). This way i'll be able to basically toggle individually between 2 different 'colouring modes' on the fly.