1

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.

hengxin
  • 1,867
  • 2
  • 21
  • 42

1 Answers1

1

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.

nobe4
  • 2,802
  • 3
  • 28
  • 54
  • Using arch, I installed `languagetool` from the package manager `pacman`. I know where the binary is, but cannot find the file `languagetool_commandline.jar`. – Student Aug 06 '19 at 14:48
  • 1
    You can use `pacman -Ql languagetool | grep commandline` to find the jar. I ran into an [issue](https://github.com/dpelle/vim-LanguageTool/issues/22) with vim-language that made me switch to [vim-grammarous](https://github.com/rhysd/vim-grammarous) that also integrates LanguageTool into Vim and Neovim. – Matthias Braun Mar 30 '21 at 22:57