-
|
I use Markdown to write blogs and recently I'm planning to utilize blockquotes (lines that start with Normally blockquotes are just completely grayed out for me, as their highlight group is linked to
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
If you use Treesitter, then VimTeX syntax highlighting is simply not compatible. That is, to my knowledge, you can't use regular built-in (legacy) Vim/Neovim syntax rules in a nested fashion when you use Treesitter for your highlighting. If you want to use VimTeX for highlighting in Markdown, then you need to use the legacy syntax method for Markdown and specify rules with nested highlighting that includes tex highlighiting. This means you need to avoid enabling Treesitter for Markdown (at least for highlighting). Exactly how to do it depends on whether you are using a plugin (like vim-markdown) or not. For vim-markdown, you could add if exists('b:did_after_syntax_markdown') | finish | endif
let b:did_after_syntax_markdown = 1
syntax region mkdBlockquote start=/^\s*>/ end=/^\s*$/
\ contains=mkdLink,mkdInlineURL,mkdLineBreak,@Spell,mkdMath |
Beta Was this translation helpful? Give feedback.

If you use Treesitter, then VimTeX syntax highlighting is simply not compatible. That is, to my knowledge, you can't use regular built-in (legacy) Vim/Neovim syntax rules in a nested fashion when you use Treesitter for your highlighting.
If you want to use VimTeX for highlighting in Markdown, then you need to use the legacy syntax method for Markdown and specify rules with nested highlighting that includes tex highlighiting. This means you need to avoid enabling Treesitter for Markdown (at least for highlighting).
Exactly how to do it depends on whether you are using a plugin (like vim-markdown) or not. For vim-markdown, you could add
after/syntax/tex.vimwith something like this: