jsmestad / spacemacs-langtool

A spacemacs layer for LanguageTool integration
5 stars 0 forks source link
emacs languagetool spacemacs spacemacs-layer writing

+TITLE: LanguageTool layer

[[file:img/languagetool.png]]

+BEGIN_SRC elisp

(setq-default dotspacemacs-configuration-layers '((languagetool :variables langtool-default-language "en-GB")))

+END_SRC

It's also possible to immediately show the error when jumping to errors with ~[ a~ and ~] a~ by setting ~languagetool-show-error-on-jump~:

+BEGIN_SRC elisp

(setq-default dotspacemacs-configuration-layers '((languagetool :variables languagetool-show-error-on-jump t)))

+END_SRC

** LanguageTool LanguageTool and JRE 8+ are required to use this layer. You can install LanguageTool using your system's package manager or by extracting the standalone archive found on [[https://www.languagetool.org/][LanguageTool's website]]. You can tell the layer where LanguageTool is installed by setting the =langtool-language-tool-jar= variable to the location of =languagetool-commandline.jar= or by setting =langtool-java-classpath=:

+BEGIN_SRC elisp

;; Standalone installation (setq-default dotspacemacs-configuration-layers '((languagetool :variables langtool-language-tool-jar "/home/username/languagetool/languagetool-commandline.jar")))

;; Classpath (e.g. after installing with `pacman -S languagetool') (setq-default dotspacemacs-configuration-layers '((languagetool :variables langtool-java-classpath "/usr/share/languagetool:/usr/share/java/languagetool/*")))

+END_SRC

| Key Binding | Description | |-------------+--------------------------------------------| | ~SPC S l~ | Toggle LanguageTool for the current buffer | | ~SPC S L~ | Perform corrections in the current buffer | | ~[ a~ | Jump to the previous LanguageTool error | | ~] a~ | Jump to the next LanguageTool error |