This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/spell-checking
Fabien Dubosson 456dcb3086 Correct few defaults of spell-checking's layer
- Disable `auto-dictionary-mode` by default. Add a layer's variable to
  enable it. Its behaviour has some impact on user-defined dictionary
  preferences, it has some bugs in daemon mode, and not all languages
  are supported. It's why it better to have it disabled by default.

- Toggle off `auto-dictionary-mode` when spell-checking is toggled off.

- Call `flyspell-buffer` when toggling **on** spell-checking to reveal
  mistakes (probably the wanted behaviour when activating
  spell-checking)

- When `auto-dictionary-mode` is enabled, if a buffer's dictionary is
  manually changed with `SPC S d`, it is restored after toggling
  spell-checking on/off, otherwise `auto-dictionary` will thy to guess
  it again.
2015-11-02 00:29:15 -05:00
..
config.el Correct few defaults of spell-checking's layer 2015-11-02 00:29:15 -05:00
funcs.el Remove spell-checking-auto-dictionary variable 2015-10-31 14:25:02 +01:00
packages.el Correct few defaults of spell-checking's layer 2015-11-02 00:29:15 -05:00
README.org Correct few defaults of spell-checking's layer 2015-11-02 00:29:15 -05:00

Spell Checking configuration layer for Spacemacs

Description

This layer provides spell checking using Flyspell and [[https://github.com/nschum/auto-dictionary-mode][auto-dictionary-mode]].

Install

Layer

To use this configuration layer add it to your ~/.spacemacs

(setq-default dotspacemacs-configuration-layers '(spell-checking))

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:

(setq-default dotspacemacs-configuration-layers
  '((spell-checking :variables spell-checking-enable-by-default nil)))

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:

(setq-default dotspacemacs-configuration-layers
  '((spell-checking :variables spell-checking-enable-auto-dictionary t)))

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