This repository has been archived by the owner on Jul 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-spellcheck.el
45 lines (40 loc) · 1.7 KB
/
init-spellcheck.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
;;; Spelling and syntax checking
(use-package ispell ; Spell checking
:defer t
:config
(setq ispell-program-name (if (eq system-type 'darwin)
(executable-find "aspell")
(executable-find "hunspell"))
ispell-dictionary "en_US" ; Default dictionary
ispell-silently-savep t ; Don't ask when saving the private dict
;; Increase the height of the choices window to take our header line
;; into account.
ispell-choices-win-default-height 5)
(unless ispell-program-name
(warn "No spell checker available. Install Hunspell or ASpell for OS X.")))
(use-package flyspell ; On-the-fly spell checking
:bind (("C-c t s" . flyspell-mode)
("C-c l b" . flyspell-buffer))
:init (progn (dolist (hook '(text-mode-hook message-mode-hook))
(add-hook hook 'turn-on-flyspell))
(add-hook 'prog-mode-hook 'flyspell-prog-mode))
:config
(progn
(setq flyspell-use-meta-tab nil
;; Make Flyspell less chatty
flyspell-issue-welcome-flag nil
flyspell-issue-message-flag nil)
;; Free C-M-i for completion
(define-key flyspell-mode-map "\M-\t" nil)
;; Undefine mouse buttons which get in the way
(define-key flyspell-mouse-map [down-mouse-2] nil)
(define-key flyspell-mouse-map [mouse-2] nil))
:diminish flyspell-mode)
(use-package helm-flyspell ; Helm interface to Flyspell
:ensure t
:after flyspell
:bind
(:map flyspell-mode-map
([remap flyspell-auto-correct-previous-word] . helm-flyspell-correct)
("C-c l c" . helm-flyspell-correct)))
(provide 'init-spellcheck)