如何使用 Vundle 安装 `vim-scripts/LanguageTool`?

How to install `vim-scripts/LanguageTool` using Vundle?

我正在安装 vim-scripts/LanguageTool plugin using Vundle:

  1. Plugin 'vim-scripts/LanguageTool'放入.vimrc
  2. 运行 :PluginInstall 在 vim 文件中(Vundle 表示 "Done")。

但是,当我运行 :LanguageToolCheck时,我得到了以下错误:

LanuageTool cannot be found at: /home/MY-USE-NAME/languagetool-2.4.1/languagetool-commandline.jar.
You need to install LanguageTool and/or set up g:languagetool_jar to indicate the location of the languagetool-commandline.jar file.

我该怎么办?谢谢。


Docs安装LanguageTool插件如下:

$ mkdir ~/.vim 
$ cd ~/.vim 
$ unzip /path-to/LanguageTool.zip 
$ vim -c 'helptags ~/.vim/doc' 

解法:

根据 Docs,此插件需要一个独立的 LanguageTool for desktop,其中包括所需的 languagetool_commandline.jar。安装它并根据下面的答案设置g:languagetool_jar

您似乎需要 link vim 内 langagetool 的路径,以便它可以找到并使用它。

在 vim 中,您可以使用以下命令 define/set 变量:

let g:languagetool_jar="/path/to/the/file.jar"

g: 表示该变量是全局变量,因此可以从每个 script/plugin 访问。在那种情况下,这意味着 LanguageTool 将知道在哪里可以找到 jar 文件。

查看 this and this 了解更多信息。