Skip to content

Commit 8c119e6

Browse files
committed
Add evil-ispell-mark-word-as-good and "zg" binding
1 parent b237462 commit 8c119e6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

evil-commands.el

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,18 @@ and jump to the corresponding one."
636636
(when ov
637637
(goto-char (overlay-start ov))))))))
638638

639+
(defun evil-ispell-mark-word-as-good (word)
640+
"Add WORD under the cursor as a good word to the Ispell dictionary."
641+
(interactive (list (thing-at-point 'word)))
642+
(ispell-send-string (concat "*" word "\n"))
643+
;; dictionary modified!
644+
(setq ispell-pdict-modified-p '(t))
645+
(ispell-pdict-save ispell-silently-savep)
646+
(when-let ((flyspell-mode)
647+
(start (car (bounds-of-thing-at-point 'word))))
648+
(flyspell-unhighlight-at start))
649+
(message "Word '%s' added to dictionary" (upcase word)))
650+
639651
(evil-define-motion evil-next-flyspell-error (count)
640652
"Go to the COUNT'th spelling mistake after point."
641653
(interactive "p")

evil-maps.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
(define-key evil-normal-state-map "za" 'evil-toggle-fold)
8383
(define-key evil-normal-state-map "zr" 'evil-open-folds)
8484
(define-key evil-normal-state-map "zm" 'evil-close-folds)
85+
(define-key evil-normal-state-map "zg" 'evil-ispell-mark-word-as-good)
8586
(define-key evil-normal-state-map "z=" 'ispell-word)
8687
(define-key evil-normal-state-map "\C-n" 'evil-paste-pop-next)
8788
(define-key evil-normal-state-map "\C-p" 'evil-paste-pop)

0 commit comments

Comments
 (0)