Doom Emacs, Hunspell, and MacOS
Doom Emacs uses spell-fu
as the default highlighter for spellchecking. spell-fu
can use several options like aspell
, hunspell
, enchant
, etc. for the actual spellchecking. I prefer to use Hunspell.
The process to install and configure hunspell
to work for Doom Emacs is simple:
- Use homebrew to install
hunspell
:
$ brew install hunspell
hunspell
doesn't install dictionaries. Download them from the aspell webpage and store them in~/Library/Spelling
. Check thathunspell
is recognizing your dictionaries.
$ hunspell -D
- Tell Doom Emacs you are using
hunspell
in yourinit.el
file:
(...)
:checkers
(spell +hunspell) ; tasing you for misspelling mispelling
-
While Doom will take care of telling Emacs which spell checker you are using, you need to specify a default dictionary. Otherwise you will go crazy wondering why
spell-fu
is marking every word in your documents as incorrect. (This applies not only forhunspell
but also foraspell
andenchant
.)You can get a list of valid dictionary names by changing the dictionary manually within Emacs, i.e.
M-x
ispell-change-dictionary
.
(setq ispell-dictionary "english")