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

Add instructions to fix underline highlight issue #147

Closed oxfist closed 1 year ago

oxfist commented 1 year ago

Hi! First of all thanks for your work on this plugin.

I ran into the issue of the highlight being just being an underline of the text and after a while looking into the issues I noticed there was a solution pointed out here https://github.com/RRethy/vim-illuminate/issues/111. I tested the Lua solution myself and got the smooth highlight working.

So I think it'd be great if this was explicit in the README in case one of your users stumbles upon this issue so they can find the solution more easily. 🙌🏼

RRethy commented 1 year ago

The underline isn't an issue and doesn't need fixing, it's a conscious decision to set a default value for the highlight groups that are used. The description smooth highlight is no less applicable to underline as it is to whatever the Visual highlight group is (which is probably just a modification of the guibg).

Not only that, but the highlight groups are mentioned in the README.

alexventuraio commented 5 months ago

Not sure whether or not it is an issue or just a custom config to add but I have lazy as package manager for Neovim and as soon as I added this as a plugin module, it worked the way the original poster of this issue mentioned, I just got underline as highlighting, and that looks awful.

After looking into the issues, I found this and by adding the following lines to my init.lua file I got the highlight in the correct way:

vim.api.nvim_set_hl(0, "IlluminatedWordText", { link = "Visual" })
vim.api.nvim_set_hl(0, "IlluminatedWordRead", { link = "Visual" })
vim.api.nvim_set_hl(0, "IlluminatedWordWrite", { link = "Visual" })

I know there is the Highlight Groups section that mentions those groups but it does not mentions which values can be assigned to replace the underline default one.

I think it would be very good to have some guidance on how to tweak this for Neovim in Lua config files.