Search code examples
viminstallationvim-pluginvundle

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


I am installing the vim-scripts/LanguageTool plugin using Vundle:

  1. Put Plugin 'vim-scripts/LanguageTool' in .vimrc;
  2. Run :PluginInstall in a vim file (and Vundle says "Done").

However, when I run :LanguageToolCheck, I got the following error:

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.

What should I do? Thanks.


The Docs installs the LanguageTool plugin as follows:

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

Solution:

According to Docs, this plugin needs a standalone LanguageTool for desktop which includes the required languagetool_commandline.jar. Install it and set g:languagetool_jar according to the answer below.


Solution

  • It seems you need to link the path to the langagetool within vim, so it can find it and use it.

    In vim you can define/set variables with the following command:

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

    The g: means that the variable is global and thus accessible from every script/plugin. In that case, it means that the LanguageTool will know where to find the jar file.

    Have a look at this and this for more information.