forked from redguardtoo/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit-flyspell.el
30 lines (28 loc) · 1.14 KB
/
init-flyspell.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
;;----------------------------------------------------------------------------
;; Add spell-checking in comments for all programming language modes
;;----------------------------------------------------------------------------
(dolist (hook '(lisp-mode-hook
emacs-lisp-mode-hook
scheme-mode-hook
clojure-mode-hook
ruby-mode-hook
yaml-mode
python-mode-hook
shell-mode-hook
php-mode-hook
css-mode-hook
haskell-mode-hook
caml-mode-hook
nxml-mode-hook
crontab-mode-hook
perl-mode-hook
tcl-mode-hook
js2-mode-hook))
(add-hook hook 'flyspell-prog-mode))
(add-hook 'nxml-mode-hook
(lambda ()
(add-to-list 'flyspell-prog-text-faces 'nxml-text-face)))
;; you can also use "M-x ispell-word" or hotkey "M-$". It pop up a multiple choice
;; @see http://frequal.com/Perspectives/EmacsTip03-FlyspellAutoCorrectWord.html
(global-set-key (kbd "C-c s") 'flyspell-auto-correct-word)
(provide 'init-flyspell)