nvim-treesitter/playground

Give information on vim highlight group under the cursor

poetaman opened this issue · 3 comments

When treesitter is enabled for a language, the :TSHighlightCapturesUnderCursor command does not return complete information for people who would want to look what vim highlight group is currently applied there.

For Lua's treesitter disabled, it shows the highlight groups; not sure why there are 3 of them. It looks confusing... Should I always look at the last line to find the actual highlight group under the cursor? PreProc is the correct answer here. If I modify the color of insert_before would change accordingly.
Screen Shot 2022-02-13 at 7 58 44 AM

For Lua's treesitter enabled, it does not show the mapping to Vim highlight group... so there is no way to know what highlight group to modify.
Screen Shot 2022-02-13 at 7 59 34 AM

NOTE: The reason I ask for Vim highlight group is I maintain a small bunch of color schemes that I use in both vim and neovim. And its duplication of work to specify treesitter-specific highlight groups in them. Given the name TSFunction makes me wonder if all treesitter highlight groups are the same as their vim counterparts without the prefix TS. If that is so, then I guess we are ok.

This is because tree-sitter disables syntax. Use :set syntax=on or additional_vim_regex_highlighting = true in your nvim-treesitter setup call for the highlight module. It will then show both because both syntax highlighters are then enabled at the same time.

@theHamsta Thats not the point. The thing is if I do hi Function ctermfg=1, it does change the color TSFunction here. Would it be possible to follow the path and change format to show ... -> TSFunction (<equivalent_vim_highlight_group>)

duplicate of #70 (in the sense that that issue is a superset of this one)