From b132794031909b829b0e7e3a7c33f07346a94324 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 1 Apr 2021 16:35:26 -0500 Subject: Set up spelling --- init.el | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/init.el b/init.el index 5e72e56..72c6c81 100644 --- a/init.el +++ b/init.el @@ -337,6 +337,21 @@ ;; (interactive) ;; (electric-helpify 'describe-symbol)) ;; (define-key ehelp-map "o" #'electric-describe-symbol) + +;;;; Spelling +(setup flyspell + (setenv "LANG" "en_US") + (:option ispell-program-name "hunspell" + ispell-dictionary "en_US" + ispell-personal-dictionary "~/.hunspell_personal") + (ispell-set-spellchecker-params) + (unless (file-exists-p ispell-personal-dictionary) + (write-region "" nil ispell-personal-dictionary nil 0)) + + ;; add hooks + (add-hook 'text-mode #'flyspell-mode) + (add-hook 'prog-mode #'flyspell-prog-mode)) + ;;;; Etc. good defaults (setc custom-file (acdw/in-dir "custom.el") inhibit-startup-screen t @@ -573,6 +588,12 @@ call `zzz-to-char'." :repo "https://git.sr.ht/~zge/nullpointer-emacs")) (:option 0x0-default-host 'ttm)) +;;;;; Flyspell-correct +(when (executable-find ispell-program-name) + (with-eval-after-load 'flyspell + (setup (:straight flyspell-correct) + (define-key flyspell-mode-map (kbd "C-;") #'flyspell-correct-wrapper)))) + ;;;; System tie-ins ;; Insctead of using `setup''s `:needs', I'm going to wrap these in ;; `exectuable-find' forms. I don't want to waste time with pulling packages -- cgit 1.4.1-21-gabe81