spacemacs/layers/spell-checking/README.org
Fabien Dubosson b644f8abd7 Move auto-dictionary to spell-checking and activate it
This commit moves the – previously disabled – `auto-dictionary` code to
the `spell-checking` layer and activate it. It is now enabled by
default, but can be disabled by setting `spell-checking-auto-dictionary`
to `nil`.

`auto-dictionary` comes with some interesting improvements:

- Tries to automatically detect what is the language of the buffer and
  activate the corresponding dictionary.

- When a buffer is opened, all spelling mistakes are shown without
  needing first to be under the cursor.

- When the dictionary is changed, the whole buffer is reanalyzed for
  spelling mistakes (close #2088).
2015-10-31 14:24:54 +01:00

60 lines
2.3 KiB
Org Mode

#+TITLE: Spell Checking configuration layer for Spacemacs
* Table of Contents :TOC@4:
- [[#description][Description]]
- [[#install][Install]]
- [[#layer][Layer]]
- [[#spell-checker-configuration][Spell Checker Configuration]]
- [[#disabling-by-default][Disabling by default]]
- [[#disabling-auto-dictionary][Disabling auto-dictionary]]
- [[#key-bindings][Key Bindings]]
* Description
This layer provides spell checking using [[http://www-sop.inria.fr/members/Manuel.Serrano/flyspell/flyspell.html][Flyspell]].
* Install
** Layer
To use this configuration layer add it to your =~/.spacemacs=
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers '(spell-checking))
#+END_SRC
** Spell Checker Configuration
The built-in Emacs variable that controls which external spell-checking program
is used 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~).
** Disabling by default
By default, =spell-checking= is enabled in all available major modes and may be
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
** Disabling auto-dictionary
By default, =spell-checking= tries to detect the current language from the
buffer content, and activate the corresponding dictionary. You can default this
to off by setting the variable =spell-checking-auto-dictionary= to =nil=:
#+BEGIN_SRC emacs-lisp
(setq-default dotspacemacs-configuration-layers
'((spell-checking :variables spell-checking-auto-dictionary nil)))
#+END_SRC
* Key Bindings
| Key Binding | Description |
|-------------+--------------------------|
| ~SPC S c~ | flyspell correct |
| ~SPC S d~ | change dictionary |
| ~SPC S n~ | flyspell goto next error |
| ~SPC t S~ | toggle flyspell |