-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No colouring in Neovim #163
Comments
Can confirm. Doesn't work with neovim 0.5 and native LSP too, sadly. |
Just found out by playing around this plugin now conflicts with TreeSitter's I'll see if TS has an issue about this conflict and whether they can solve it since, in the balance between highlighted parnes and TS, I know what I prefer better. |
The response I got from TS team: nvim-treesitter/nvim-treesitter#1855 Using the suggested plugin (after configuring up to 7 colors in the plugin's config section) works like magic, although, as the commenter says, with a slight hit to performance while TS is parsing the file. I suggest closing this issue as a solution is provided by TS team. |
Just for completeness: aside from mapping highlight = {
enable = true,
custom_captures = {
["punctuation.bracket"] = "",
["constructor"] = "",
},
}, You can get capture group under cursor using EDIT: Seems like you can unmap elements not only in initial configuration, but anytime (with |
Okay, I'm dumb and it is actually way easier to do with remapping highlight and also allows language-specific modifications vim.cmd[[augroup rainbow]]
vim.cmd[[ au BufEnter * hi TSPunctBracket NONE]]
vim.cmd[[ au BufEnter * hi link TSPunctBracket nonexistenthl]]
vim.cmd[[ au BufEnter *.lua hi TSConstructor NONE]]
vim.cmd[[ au BufEnter *.lua hi link TSConstructor nonexistenthl]]
vim.cmd[[augroup END]] |
Cool! It's so great having options, and both working great! |
*Sigh* |
On top of treesitter btw, if you're using a LSP server/client with support for Semantic Tokens, highlighting from this plugin can also be overridden by other groups. For example, I'm using coc.nvim, treesitter and gruvbox-material (supports both coc.nvim and treesitter). In a Dockerfile (dockerfile-language-server-nodejs), colour of brackets after with semantic tokens So the thing about parenthesis highlighting is, I don't think I even want it to be syntax-wise correct sometimes. Something straightforward like this repo is exactly what I actually need. Another problem about relying on treesitter to highlight parentheses is that, you don't get colour at all if it's not supported by treesitter. Not to mention there are still quite a number of languages missing from nvim-ts-rainbow itself. |
Haven't enabled almost anything explicitly yet because of [1]; I like rainbow. Should be simple to fix, just requires some config changes. Have definitely enabled TS for .tex files though, since the native syntax highlighting is way too slow. [1] luochen1990/rainbow#163
For new people coming across this, you now have to remap the bracket group by vim.api.nvim_set_hl(0, "@punctuation.bracket", { link = "" }) since treesitter no longer reads |
Describe the bug
I have installed this plugin but I am not getting any highlighting in normal mode. When I select the brackets in visual mode, I am to see the pair colorised brackets, but I am unable to see any highlight in normal/insert mode
To Reproduce
I have just installed it and enabled it in plug config. I am getting no errors. How can I debug further ?
Expected behavior
The syntax highlighting should work?
Screenshots
Provide a screenshot to describe what you got.
Additional context
Are you using some third-party syntax plugins? Add any other context about the problem here.
I am using coc.nvim and tree sitter for highlighting
and I am using this theme: https://github.com/haishanh/night-owl.vim
The text was updated successfully, but these errors were encountered: