added languagetool spellchecking
This commit is contained in:
58
init.el
58
init.el
@@ -223,6 +223,8 @@
|
||||
(add-hook 'after-init-hook 'rainbow-mode)
|
||||
|
||||
|
||||
;; TODO add fast rudimentary spell check
|
||||
;; leaving this in for now, maybe i could add fast rudimentary spell checking and then use languagetool for slower more thorough spell checks
|
||||
;; doesnt work yet?
|
||||
;; it should only do these when ispell is loaded
|
||||
;; idk
|
||||
@@ -237,8 +239,9 @@
|
||||
|
||||
|
||||
|
||||
|
||||
(use-package flycheck :ensure t :defer t :hook after-init)
|
||||
;; TODO do we need flycheck anymore?
|
||||
;; i don't think so?
|
||||
;; (use-package flycheck :ensure t :defer t :hook after-init)
|
||||
;; (use-package flycheck-languagetool
|
||||
;; :ensure t
|
||||
;; :hook (text-mode . flycheck-languagetool-setup)
|
||||
@@ -260,7 +263,7 @@
|
||||
( "C->" . mc/mark-next-like-this)
|
||||
( "C-<" . mc/mark-previous-like-this)
|
||||
( "C-c C-<" . mc/mark-all-like-this)
|
||||
( "C-\"" . mc/skip-to-next-like-this)
|
||||
( "C-^\"" . mc/skip-to-next-like-this)
|
||||
( "C-:" . mc/skip-to-previous-like-this)
|
||||
)
|
||||
)
|
||||
@@ -299,11 +302,50 @@
|
||||
; '(haskell-mode . ("haskell-language-server-wrapper" "--lsp")))
|
||||
)
|
||||
|
||||
(with-eval-after-load 'eglot
|
||||
(add-to-list 'eglot-server-programs
|
||||
'(text-mode . ("harper-ls" "--stdio"))
|
||||
'(markdown-mode . ("harper-ls" "--stdio"))
|
||||
))
|
||||
;; spell checking with languagetool, slow but thorough
|
||||
;; dowloaded:
|
||||
;; https://languagetool.org/download/ngram-data/ngrams-de-20150819.zip
|
||||
;; https://languagetool.org/download/ngram-data/ngrams-en-20150817.zip
|
||||
;; https://languagetool.org/download/LanguageTool-stable.zip
|
||||
;; and put them in a directory like this
|
||||
;; emacs-init-dir/.languagetool/contents of LanguageTool-stable.zip like languagetool-server
|
||||
;; emacs-init-dir/.languagetool/contents of ngram.* like de or en
|
||||
(use-package languagetool
|
||||
:ensure t
|
||||
:defer t
|
||||
:commands (languagetool-check
|
||||
languagetool-clear-suggestions
|
||||
languagetool-correct-at-point
|
||||
languagetool-correct-buffer
|
||||
languagetool-set-language
|
||||
languagetool-server-mode
|
||||
languagetool-server-start
|
||||
languagetool-server-stop)
|
||||
:config (setq languagetool-java-arguments (list "-Dfile.encoding=UTF-8" (concat "--languagemodel " (concat user-emacs-directory ".languagetool/ngram-data")))
|
||||
languagetool-console-command (concat user-emacs-directory (concat ".languagetool/languagetool-commandline.jar"))
|
||||
languagetool-console-arguments (list (concat user-emacs-directory "--languagemodel") " .languagetool/ngram-data")
|
||||
languagetool-server-command (concat user-emacs-directory (concat ".languagetool/languagetool-server.jar"))
|
||||
languagetool-server-arguments (list (concat user-emacs-directory "--languageModel") " .languagetool/ngram-data")
|
||||
)
|
||||
)
|
||||
|
||||
;; TODO make languagetool languagte toggle function
|
||||
;; defun my/languagetool-toggle-language
|
||||
;; switch between auto, en, de
|
||||
;; have it be auto or de by default and then switch either to en or to de
|
||||
;; like auto -> de
|
||||
;; or de -> en
|
||||
;; or maybe just like that
|
||||
;; first auto then de then en
|
||||
;; TODO evaluate how i wanna do this
|
||||
|
||||
|
||||
|
||||
;; (with-eval-after-load 'eglot
|
||||
;; (add-to-list 'eglot-server-programs
|
||||
;; '(text-mode . ("harper-ls" "--stdio"))
|
||||
;; '(markdown-mode . ("harper-ls" "--stdio"))
|
||||
;; ))
|
||||
|
||||
;; flycheck told me to do this:
|
||||
(provide 'init)
|
||||
|
||||
Reference in New Issue
Block a user