Closed SichangHe closed 1 year ago
Same here. Tried disabling LSP
and treesitter
- no highlighting. a-n
and a-p
work.
Output from :IlluminateDebug
buf_should_illuminate 7 true
config {
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: 0x0110553e18 lsp
`termguicolors` true
:checkhealth
doesn't report any error .
$ nvim --version
NVIM v0.9.0-dev-521+g1c4794944-dirty
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by me@foo.local
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/Cellar/neovim/HEAD-1c47949/share/nvim"
Run :checkhealth for more info
$ uname -a
Darwin foo.local 21.6.0 Darwin Kernel Version 21.6.0: Sun Nov 6 23:31:16 PST 2022; root:xnu-8020.240.14~1/RELEASE_X86_64 x86_64
@SichangHe you probably need to turn on :set termguicolors
since your IlluminateDebug
shows that option as being turned off.
@jamezwhocares please open another issue with the issue template filled out (and include the output from :hi IlluminatedWordText
, :hi IlluminatedWordRead
, :hi IlluminatedWordWrite
), your issue looks different. If I had to guess you might not have highlight groups defined which would indicate you are calling :hi clear
somewhere (or something you use calls it), creating a minimal init.lua should make it obvious where this is being done.
@SichangHe you probably need to turn on
:set termguicolors
since yourIlluminateDebug
shows that option as being turned off.
That option works.
However, in my case the problem is from onedark.nvim
, and I need to manually set the three highlight groups:
require('packer').startup(function(use)
use {
'RRethy/vim-illuminate',
}
use {
'navarasu/onedark.nvim',
config = function()
local onedark = require('onedark')
onedark.setup {
style = 'light',
highlights = {
IlluminatedWordText = { bg = '#e6e6e6' },
IlluminatedWordRead = { bg = '#e6e6e6' },
IlluminatedWordWrite = { bg ='#e6e6e6' },
},
}
onedark.load()
end,
}
end)
(Note: the color here are copied from hi LspReferenceText
.)
Thank you, @RRethy, for your useful hint.
@SichangHe The problem is actually with packer. It is loading plugins in the incorrect order, user-configuration should be guaranteed to run prior to plugin code :h initialization
, but packer breaks that ordering.
I thought that way, too. But, it still did not work after I specified a requires
for vim-illuminate
to tell packer to load it after onedark
.
Anyway, underline with onelight looks bad and I would need to change the highlight group anyway.
@RRethy thanks for pointing to problem: it was similar to @SichangHe: I have rose-pine
theme, and it was interfering/clearing highlight groups (I'm using packer
, too, and vim-illuminate
is loading last).
Something like this helps out:
require('rose-pine').setup({
disable_background = true,
highlight_groups = {
IlluminatedWordText = { style = 'underline' },
IlluminatedWordRead = { style = 'underline' },
IlluminatedWordWrite = { style = 'underline' },
},
})
Describe the bug I have just installed
vim-illuminate
with Packer and loaded it, but I don't have words under cursor highlighted.To Reproduce Steps to reproduce the behavior (include minimal
init.vim
or.vimrc
):init.lua
::PackerCompile
(no:PackerSync
because already run before).init.lua
.use
, notice that neitheruse
is highlighted.Output from
:IlluminateDebug
Expected behavior Both
use
should be highlighted via Regex matching.Screenshots![Screen Shot 2](https://user-images.githubusercontent.com/84777573/213918940-edf92b2a-53a4-4265-ac0d-6748fa728e64.png)
Additional context Initially, I tried with Lsp plugins, and it did not highlight variables under cursor either.