Closed idvorkin closed 8 months ago
I can workaround this with the following settings, but it results in me losing the treesitter markdown speedups
require'nvim-treesitter.configs'.setup {
highlight = {
additional_vim_regex_highlighting = {'markdown','markdown_inline'},
},
}
Works for me. Make sure your color scheme sets or links the correct highlight groups (which are different from the legacy syntax groups). In any case, this is not a parser issue so OT here.
Exactly, this is possibly a problem with neovim or your specific configuration, but not with this parser.
@clason - Thanks, I'm guessing you're right, but not sure how to debug. Can you share the highlight groups I need to light up to verify?
use :Inspect
(Sorry for the n00b questions, it's hard to find simple documentation here, feel free to link me that)
Here's what I'm getting for inspect and inspect tree.
Does this match what you get? Assuming it matches, how do I connect from here to neovim syntax highlighting?
:InspectTree
You need to have the cursor on the exact text you want to :Inspect
: (:h Inspect
)
TL;DR: Install a TS compatible colorscheme. I picked: https://github.com/catppuccin/nvim
Details I now understand what you're telling me. TS is creating syntax elements correctly, but no highlight is configured for that (I'm using the vim default color schemes). You can see this for yourself:
Install the TSPlayground and then :TSHighlightCapturesUnderCursor
to see what the TS element was.
You can see something similar with syntax files via:
:echo synIDattr(synID(line("."), col("."), 1), "name")
You can then bind the highlight group to the TS element
highlight link @text.emphasis htmlItalic
highlight link @text.strong htmlBold
Sweet - thanks for the help @clason! Also, thanks for making the awesome plugin @MDeiml! Have a great day!
Install the TSPlayground and then :TSHighlightCapturesUnderCursor to see what the TS element was.
:Inspect
does the same (but better) and is built-in. (playground is deprecated)
I don't get inline bold or italics (I'm guessing I'm configuring something wrong, but no clue what :( )
For folks that don't want to read the thread: Install a TS compatible colorscheme. I picked: https://github.com/catppuccin/nvim
The code
Actual behavior
Now when I disable TS, I get what I'd expect with the default vim highlighting