如何为 Neovim 创建 Latex 树解析器?

问题描述 投票:0回答:0

我目前正在尝试为 Neovim 配置我的树解析器,但我不明白我必须做什么才能使 Latex 工作。

这是我的树保姆conf文件(使用lazy-vim作为插件管理器):

return {
    "nvim-treesitter/nvim-treesitter",
        build = ":TSUpdate",
        config = function()
            local configs = require("nvim-treesitter.configs")
            configs.setup({
                ensure_installed = {
                    "bash",
                    "c",
                    "cpp",
                    "glsl",
                    "haskell",
                    "hlsl",
                    "latex",
                    "lua",
                    "make",
                    "python",
                    "rust"
                },
                highlight = { enable = true },
                indent = { enable = true },
            })
        end
}

当我再次启动 nvim 时,它说“tree-sitter 不可执行”和“需要从语法定义生成乳胶”,这对我没有真正的帮助。

我访问了 Latex Tree-sitter 的 git repo (https://github.com/latex-lsp/tree-sitter-latex),上面写着: “要生成解析器,请在检查存储库后运行

npx tree-sitter generate
。”

我真心不明白这是什么意思。我尝试在互联网上查找:什么也没有。我安装了 npm 并尝试用它安装乳胶树保姆:没有成功。我按照他们所说的那样运行了命令:错误没有目标。

我现在不知道该怎么办...

neovim treesitter
© www.soinside.com 2019 - 2024. All rights reserved.