diff --git a/doc/vimtex.txt b/doc/vimtex.txt index a5984ac960..5635a27e81 100644 --- a/doc/vimtex.txt +++ b/doc/vimtex.txt @@ -5598,6 +5598,7 @@ Contents: * |vimtex-faq-texmfhome| * |vimtex-faq-wsl| * |vimtex-faq-zathura-macos| +* |vimtex-faq-treesitter| ------------------------------------------------------------------------------ *vimtex-faq-windows* @@ -5890,8 +5891,29 @@ A: VimTeX implements a traditional syntax script for syntax highlighting of let g:vimtex_syntax_enabled = 0 let g:vimtex_syntax_conceal_disable = 1 < +Q: How to use Vimtex with markdown plugins that needs treesitter enabled? +A: If one wants to use plugins alongside Vimtex in a markdown document that + requires treesitter highlighting to be enabled one can do: > + + require 'nvim-treesitter.configs'.setup { + ensure_installed = { "markdown" }, + highlight = { + enable = true, + disable = { "latex" }, + additional_vim_regex_highlighting = { "latex", "markdown" }, + }, + --other treesitter settings + } +< + Be warned though that this does not disable the legacy syntax engine when + attaching a treesitter parser (via syntax off), i.e., it runs both + treesitter and regex highlighting in parallel (completely negating any + performance benefit, and possibly can lead to weird results since both + types of highlighting are applied, one over the other). + [0]: https://tree-sitter.github.io/tree-sitter/ [1]: https://github.com/nvim-treesitter/nvim-treesitter + [2]: https://github.com/nvim-treesitter/nvim-treesitter#available-modules ============================================================================== TROUBLESHOOTING *vimtex-troubleshooting*