File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 3333(require 'evil-jumps )
3434(require 'evil-vars )
3535(require 'flyspell )
36+ (require 'ispell )
3637(require 'cl-lib )
3738(require 'reveal )
3839
@@ -636,6 +637,29 @@ and jump to the corresponding one."
636637 (when ov
637638 (goto-char (overlay-start ov))))))))
638639
640+ (defun evil-ispell-mark-word-as-good (word )
641+ " Add WORD under the cursor as a good word to the Ispell dictionary."
642+ (interactive (list (thing-at-point 'word )))
643+ (ispell-send-string (concat " *" word " \n " ))
644+ ; ; dictionary modified!
645+ (setq ispell-pdict-modified-p '(t ))
646+ (ispell-pdict-save ispell-silently-savep)
647+ (when (bound-and-true-p flyspell-mode)
648+ (let ((start (car (bounds-of-thing-at-point 'word ))))
649+ (and start
650+ (flyspell-unhighlight-at start))))
651+ (message " Word '%s ' added to dictionary " (upcase word)))
652+
653+ (defun evil-ispell-mark-word-as-locally-good (word )
654+ " Add WORD under the cursor to the local word list."
655+ (interactive (list (thing-at-point 'word )))
656+ (ispell-add-per-file-word-list word)
657+ (when (bound-and-true-p flyspell-mode)
658+ (let ((start (car (bounds-of-thing-at-point 'word ))))
659+ (and start
660+ (flyspell-unhighlight-at start))))
661+ (message " Word '%s ' added to local word list " (upcase word)))
662+
639663(evil-define-motion evil-next-flyspell-error (count )
640664 " Go to the COUNT'th spelling mistake after point."
641665 (interactive " p" )
Original file line number Diff line number Diff line change 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 )
86+ (define-key evil-normal-state-map " zG" 'evil-ispell-mark-word-as-locally-good )
8587(define-key evil-normal-state-map " z=" 'ispell-word )
8688(define-key evil-normal-state-map " \C -n" 'evil-paste-pop-next )
8789(define-key evil-normal-state-map " \C -p" 'evil-paste-pop )
You can’t perform that action at this time.
0 commit comments