Closed nlsun closed 1 month ago
Ok, so I found a previous issue https://github.com/stsewd/tree-sitter-comment/issues/31 and while the suggestion
vim.api.nvim_set_hl(0, "@text.uri.comment", {bg="#333333"})
pointed me in the right direction, so i figured that what i wanted was
vim.api.nvim_set_hl(0, "@comment.note.comment", { link = "Todo" })
but then that didn't actually work for me. Nothing changed.
I then found a link to the treesitter readme with similar info https://github.com/nvim-treesitter/nvim-treesitter?tab=readme-ov-file#highlight
-- Highlight the @foo.bar capture group with the "Identifier" highlight group
vim.api.nvim_set_hl(0, "@foo.bar", { link = "Identifier" })
but that was the same info as before.
I tried a couple other things but what finally worked was this suggestion https://www.reddit.com/r/neovim/comments/13u606c/nvim_set_hl_not_working_in_the_config_file/
vim.api.nvim_create_autocmd("ColorScheme", {
pattern = "*",
callback = function()
vim.api.nvim_set_hl(0, "@comment.note.comment", { link = "Todo" })
end,
})
So now it works! But i'm curious if you have an idea of why this autocmd was necessary, otherwise feel free to close!
Hi, as you figured out, nvim-treesitter is the place to check for customizing the colors. I guess If you don't want to use an autocommand, you can try putting those settings after your colorscheme loads.
Right now, the comment tags are displayed differently, for example
TODO
is more noticeable, butXXX
andNOTE
are less obvious. Is it possible to add some way to configure how they are displayed? For example I'd likeTODO
,XXX
andNOTE
to all be the super noticeable category.