about summary refs log tree commit diff
path: root/users/sterni
diff options
context:
space:
mode:
Diffstat (limited to 'users/sterni')
-rw-r--r--users/sterni/emacs/default.nix6
-rw-r--r--users/sterni/emacs/init.el11
2 files changed, 17 insertions, 0 deletions
diff --git a/users/sterni/emacs/default.nix b/users/sterni/emacs/default.nix
index a3946a47972a..606fcb14e09e 100644
--- a/users/sterni/emacs/default.nix
+++ b/users/sterni/emacs/default.nix
@@ -16,6 +16,7 @@ let
     epkgs.melpaPackages.dockerfile-mode
     epkgs.melpaPackages.haskell-mode
     epkgs.melpaPackages.jq-mode
+    epkgs.melpaPackages.languagetool
     epkgs.melpaPackages.markdown-mode
     epkgs.melpaPackages.nix-mode
     epkgs.melpaPackages.sly
@@ -40,8 +41,13 @@ let
         name = "injected-emacs.d";
         destination = "/nix-inject.el";
         text = ''
+          ;; bqn-mode
           (setq bqn-interpreter-path "${pkgs.cbqn}/bin/BQN")
 
+          ;; languagetool
+          (setq languagetool-java-bin "${pkgs.jre}/bin/java")
+          (setq languagetool-language-tool-jar "${pkgs.languagetool}/share/languagetool-commandline.jar")
+
           (provide 'nix-inject)
         '';
       })
diff --git a/users/sterni/emacs/init.el b/users/sterni/emacs/init.el
index 16116f247216..b19701b503c1 100644
--- a/users/sterni/emacs/init.el
+++ b/users/sterni/emacs/init.el
@@ -178,6 +178,17 @@
   :mode (("\\.md\\'" . markdown-mode)))
 (use-package adoc-mode
   :mode (("\\.adoc\\'" . adoc-mode)))
+(use-package languagetool
+  :after evil
+  :custom
+  languagetool-java-arguments '("-Dfile.encoding=UTF-8")
+  languagetool-default-language "en-GB"
+  languagetool-mother-tongue "de-DE"
+  :config
+  (evil-define-key 'normal 'global (kbd "<leader>ll") 'languagetool-check)
+  (evil-define-key 'normal 'global (kbd "<leader>lc") 'languagetool-correct-at-point)
+  (evil-define-key 'normal 'global (kbd "<leader>ls") 'languagetool-set-language)
+  (evil-define-key 'normal 'global (kbd "<leader>lr") 'languagetool-clear-buffer))
 
 (require 'subscriptions)
 (require 'nix-inject)