Closed aryabhatta-dey closed 1 year ago
Thanks! It would be nice if you could explain what additional_vim_regex_highlighting
does?
It 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 leading to weird results since both types of highlighting are applied, one over the other).
It's a band-aid that's not really recommended as a practical solution.
To quote directly from the readme of https://github.com/nvim-treesitter/nvim-treesitter "Setting this to true will run :h syntax
and tree-sitter at the same time. Set this to true
if you depend on 'syntax' being enabled (like for indentation). Using this option may slow down your editor, and you may see some duplicate highlights. Instead of true it can also be a list of languages".
I haven't yet experienced any negative effects but yes it's true it duplicates effort and is a band aid solution. But I prefer that loss in efficiency over loosing either nvim-FeMaco or Vimtex.
Cool, thanks for the explanations!
@aryabhatta-dey if you think we should make an update to the docs; would you care to propose a first version of this update?
Sure. Should I submit it as a pr with only documentation changes?
Yes, that would be great :)
Hey! Just made a pr https://github.com/lervag/vimtex/pull/2484. Sorry for not getting back to you so long. Please take a look and let me know what you think.
Thanks! I'll check it out now. I believe this issue can be closed now? (Feel free to reopen if I missed something.)
Is there anyway to remove the message that vimtex puts out about treesitter syntax?
Yes: use let g:vimtex_syntax_enabled = 0
or vim.g.vimtex_syntax_enabled = 0
.
This might be a weird thing to ask, but since I use treesitter with:
additional_vim_regex_highlighting = { "latex" },
I hoped there was a way to get rid of the message and not the support. vim.g.vimtex_syntax_enabled = 0
disables conceal on my system even with additional_vim_reg_highlighting, but I would like to get rid of the warning, not the support. Is this possible?
Ah, that's right. I agree that in this case there is no need for the warning. I've tried to update the check so that it only outputs the warning if VimTeX syntax is not active. Can you please update and check if it works?
It would be nice if you also checked if the warning is still there if you remove additional_vim_regex_highlighting
. :)
The warning is all gone! Thank you so much! I want to say I love this plugin so much. Is there any way we can sponsor you?
Glad to hear it, and thanks for the kind words! I don't mind donations, of course - there's a paypal badge on the README. <3
But I will also be glad if you instead choose to "pass it on" by donating to some cause you believe in, be it charity or other FOSS projects. :)
Not really an issue rather a suggestion.
Currently, Vimtex's documentation suggests not to install markdown or latex Treesitter parsers if one wants to use Vimtex for recognizing mathzones. But this means one cannot use plugins like https://github.com/AckslD/nvim-FeMaco.lua.
So to get around the problem one can do
I have tested this config out with small markdown files and as of the moment I can use both nvim-FeMaco and Vimtex's mathzones in the same file.