From 98e7c859e44c531e07a1f2db3e347f40960e2e7b Mon Sep 17 00:00:00 2001 From: aryabhatta-dey Date: Fri, 9 Sep 2022 19:01:24 +0530 Subject: [PATCH] Made changes to doc/vimtex.txt vimtex-faq-treesitter section according to the discussion in https://github.com/lervag/vimtex/issues/2469 --- doc/vimtex.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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*