Noa*_*m E 5 windows neovim treesitter
英语不好(抱歉)。我试图让 nvim_treesitter 在我的 Windows 机器上工作,在我的 Linux 机器上工作得很好,但现在当我在 Windows 上尝试时, :checkhealth nvim_treesitter 给出:
tree-sitter找不到可执行文件git找到可执行文件。cc找不到可执行文件。
图例: H[ighlight]、L[ocals]、F[olds]、I[ndents] *) 找到多个解析器,只会使用一个 x) 查询中发现错误,尝试运行 :TSUpdate {lang}
我对这件事完全陌生,任何建议都会有帮助:)
小智 10
从我的角度来看,主要问题是“ ERROR: cc executable not found.”。这意味着 nvim_treesitter 在您的机器上找不到任何编译器,因此当您发出“ :TSInstall {some_parser_name}”命令时,无法编译和安装解析器。
如果您安装了 Visual Studio(因为 nvim 是由 VS 2017 编译的,所以我猜有 2017 或 2019 studio 就可以了),请尝试以下操作:
如果您已下载 nvim-win64 发行包,请运行“x64 Native Tools Command Prompt for VS 201x”,否则运行“x86 Native Tools Command Prompt for VS 201x”(nvim-win32 包)
nvim-qt在此命令提示符(即GUI)中运行 nvim
安装您想要的任何解析器,比如说“ :TSInstall c”。输出应如下所示:
Downloading...
Compiling...
Treesitter parser for c has been installed.
Run Code Online (Sandbox Code Playgroud)
(可选)再次运行:checkhealth nvim_treesitter以查看是否一切正常
此后,您可以在任何控制台中运行 nvim,而不仅仅是通过 VS Tools 运行(不过仍然使用它来安装或更新解析器)。
另请参阅https://github.com/nvim-treesitter/nvim-treesitter/wiki/Windows-support了解各种说明。