summaryrefslogtreecommitdiffstats
path: root/lisp/init-flyspell.el
blob: fccada583337a7c33f7d7022c33081f111f501c4 (plain) (blame)
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
;;; init-flyspell.el --- configure flyspell  -*- lexical-binding:t -*-
;;; Commentary:
;;; Code:

(use-package flyspell
  ;; load flyspell automatically for these modes
  :hook ((git-commit-mode . flyspell-mode)
         (gfm-mode . flyspell-mode)
         (org-mode . flyspell-mode)
         (latex-mode . flyspell-mode))

  :config
  ;; prefer hunspell
  (when (executable-find "hunspell")
    (setq ispell-program-name "hunspell")))

(use-package flyspell-correct
  :ensure t
  :after flyspell
  :bind (:map flyspell-mode-map
              ("C-c s" . flyspell-correct-wrapper)))

(provide 'init-flyspell)

;;; init-flyspell.el ends here