I use flyspell-correct
for
spell-checking my buffers.
use-package flyspell-correct
(
:after flyspell
:bind
(:map flyspell-mode-map"C-;" . flyspell-correct-wrapper))
(
(:map evil-normal-state-map"z=" . flyspell-correct-wrapper)))
(
use-package flyspell
(nil
:ensure
:init'text-mode-hook 'flyspell-mode)
(add-hook
:configsetq ispell-program-name (executable-find "hunspell"))) (
{config, pkgs,...}:
{
home.packages = [
pkgs.hunspell
pkgs.hunspellDicts.en-us-large];
}
I have cce/append-hunspell-current
modified from EmacsWiki which
I can call to add the current word at point to my personal
dictionary.
require 'cl))
(eval-when-compile (
defun cce/append-hunspell-word (new-word)
(let ((file-name (substitute-in-file-name "$HOME/.hunspell_en_US"))
(lambda (file-name)
(read-words (let ((all-lines (with-temp-buffer
(
(insert-file-contents file-name)"\n" t))))
(split-string (buffer-string) if (null all-lines)
(""
'identity all-lines "\n")
(split-string (mapconcat nil
t))))))
when (file-readable-p file-name)
(let* ((cur-words (apply read-words (list file-name)))
(cons new-word cur-words))
(all-words (nil (remove-duplicates all-words :test 'string=))))
(words (delq
(with-temp-file file-name 'identity (sort words #'string<) "\n")))))
(insert (mapconcat unless (file-readable-p file-name)
(
(with-temp-file file-name"\n"))))
(insert new-word t) ; restart ispell
(ispell-kill-ispell
(flyspell-mode-off)
(flyspell-mode-on))
defun cce/append-hunspell-current ()
("Add current word to aspell dictionary"
(interactive)'word t)))
(cce/append-hunspell-word (thing-at-point
'normal 'flyspell-mode-map (kbd "zi") #'cce/append-hunspell-current) (evil-define-key