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.23k stars 53 forks source link

Does not work out of the box without `termguicolors` #207

Closed kovasap closed 3 months ago

kovasap commented 3 months ago

Describe the bug With my config, I can only get illuminate to visually work when I :set termguicolors.

Is there a specific set of highlight groups my colorscheme must define for illuminate to work?

To Reproduce Steps to reproduce the behavior (include minimal init.vim or .vimrc):

  1. Load https://github.com/kovasap/dotfiles/blob/master/.vim/init.lua
  2. Open a file
  3. Mouse over a symbol

Output from :IlluminateDebug

buf_should_illuminate 1 true
config {
  case_insensitive_regex = false,
  delay = 100,
  filetype_overrides = {},
  filetypes_allowlist = {},
  filetypes_denylist = { "dirbuf", "dirvish", "fugitive" },
  min_count_to_highlight = 1,
  modes_allowlist = {},
  modes_denylist = {},
  providers = { "lsp", "treesitter", "regex" },
  providers_regex_syntax_allowlist = {},
  providers_regex_syntax_denylist = {},
  under_cursor = true
}
started true
provider table: 0x7fdf32031330 treesitter
`termguicolors` false

Expected behavior Common symbols should illuminate on mouse over.

RRethy commented 3 months ago

That is not a minimal config, your colorscheme is likely the issue.

kovasap commented 3 months ago

Yes I realize that - by filing this issue I was hoping to learn more about what illuminate requires from a color scheme to work. That would help me figure out what I would need to change with my color scheme. Are these requirements documented anywhere?

On Tue, Jul 30, 2024, 2:31 PM Adam Regasz-Rethy @.***> wrote:

That is not a minimal config, your colorscheme is likely the issue.

— Reply to this email directly, view it on GitHub https://github.com/RRethy/vim-illuminate/issues/207#issuecomment-2259247167, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC3NAUWI6A2UX3VZOPTCEDZPAA2ZAVCNFSM6AAAAABLW5TQ2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJZGI2DOMJWG4 . You are receiving this because you authored the thread.Message ID: @.***>

kovasap commented 3 months ago

Turns out my issue was that I was defining the illuminate highlight groups like in the readme:

vim.cmd('hi IlluminatedWordText gui=underline')
vim.cmd('hi IlluminatedWordRead gui=underline')
vim.cmd('hi IlluminatedWordWrite gui=underline')

When I should have been doing:

vim.cmd('hi IlluminatedWordText cterm=underline')
vim.cmd('hi IlluminatedWordRead cterm=underline')
vim.cmd('hi IlluminatedWordWrite cterm=underline')