2015-12-02 14:23:39 +00:00
#+TITLE : Spell Checking layer
2015-08-11 18:00:16 +00:00
2016-03-31 02:59:55 +00:00
* Table of Contents :TOC_4_gh:noexport:
2017-05-22 14:16:12 +00:00
- [[#description ][Description ]]
- [[#install ][Install ]]
- [[#layer ][Layer ]]
- [[#spell-checker-configuration ][Spell Checker Configuration ]]
- [[#disabling-by-default ][Disabling by default ]]
- [[#enabling-auto-dictionary-mode ][Enabling auto-dictionary-mode ]]
- [[#enable-auto-completion-popup ][Enable auto-completion popup ]]
- [[#key-bindings ][Key Bindings ]]
2015-08-11 18:00:16 +00:00
* Description
2016-05-16 12:39:39 +00:00
This layer provides spell checking using [[http://www-sop.inria.fr/members/Manuel.Serrano/flyspell/flyspell.html ][Flyspell ]] and [[https://github.com/nschum/auto-dictionary-mode ][auto-dictionary-mode ]].
2015-08-11 18:00:16 +00:00
* Install
** Layer
2016-01-06 05:21:55 +00:00
To use this configuration layer, add it to your =~/.spacemacs= . You will need to
add =spell-checking= to the existing =dotspacemacs-configuration-layers= list in this
file.
2015-08-11 18:00:16 +00:00
** Spell Checker Configuration
The built-in Emacs variable that controls which external spell-checking program
2015-09-28 06:05:18 +00:00
is use d is =ispell-program-name= , which can be set in your
=dotspacemacs/user-init= function if you do not like the default. It will give
priority to =aspell= if it is installed on your system. Another important
variable to be aware of is =ispell-dictionary= which will control the default
dictionary used by =ispell-program-name= (instead of using this variable you can
also use the key binding ~SPC S d~ ).
2015-08-11 18:00:16 +00:00
2015-08-28 11:02:20 +00:00
** Disabling by default
2015-10-20 13:05:24 +00:00
By default, =spell-checking= is enabled in all available major modes and may be
2015-08-28 11:02:20 +00:00
toggled off with ~SPC t S~ . You can default this to off by setting the variable
=spell-checking-enable-by-default= to =nil= :
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
'((spell-checking :variables spell-checking-enable-by-default nil)))
#+END_SRC
2015-08-11 18:00:16 +00:00
2015-11-01 16:27:44 +00:00
** Enabling auto-dictionary-mode
=auto-dictionary-mode= tries to detect the current language from the buffer
content, and activate the corresponding dictionary. You can enable it by setting
the variable =spell-checking-enable-auto-dictionary= to something other than
=nil= :
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
'((spell-checking :variables spell-checking-enable-auto-dictionary t)))
#+END_SRC
2015-11-02 07:25:28 +00:00
Some people encountered bugs with =auto-dictionary-mode= , especially in *daemon
mode* where new =emacsclient= open directly freezed. If so, no other workaround
have been found yet than disabling =auto-dictionary-mode= completely.
Not all languages are supported by =auto-dictionary-list= . The supported
languages are listed in the =adict-language-list= variable, that can be checked
with =spacemacs/describe-variable= . For convenience, here is the list of
currently supported language:
| Language |
|-------------------|
| catalan |
| classical greek |
| danish |
| english |
| esperanto |
| french |
| german |
| hindi |
| hungarian |
| modern greek |
| norwegian bokmål |
| norwegian nynorsk |
| portuguese |
| romanian |
| slovak |
| slovene |
| spanish |
| swedish |
2016-06-02 02:52:05 +00:00
** Enable auto-completion popup
To enable auto-completion popup when the point is idle on a misspelled word
set the layer variable =enable-flyspell-auto-completion= to t:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
2017-01-25 14:19:47 +00:00
'((spell-checking :variables enable-flyspell-auto-completion t)))
2016-06-02 02:52:05 +00:00
#+END_SRC
2015-08-11 18:00:16 +00:00
* Key Bindings
2016-06-10 04:09:42 +00:00
| Key Binding | Description |
|-------------+--------------------------|
| ~SPC S b~ | flyspell whole buffer |
| ~SPC S c~ | flyspell correct |
| ~SPC S d~ | change dictionary |
| ~SPC S n~ | flyspell goto next error |
| ~SPC t S~ | toggle flyspell |