Skip to content

Treesitter alongside vimtex #2469

@aryabhatta-dey

Description

@aryabhatta-dey

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

require("nvim-treesitter.configs").setup({
	ensure_installed = { "markdown" },
	highlight = {
		enable = true,
		disable = { "latex" },
		additional_vim_regex_highlighting = { "latex", "markdown" },
	},
	--other treesitter settings
})

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions