diff --git a/layers/+checkers/spell-checking/README.org b/layers/+checkers/spell-checking/README.org index fe1841fd8..413091c8a 100644 --- a/layers/+checkers/spell-checking/README.org +++ b/layers/+checkers/spell-checking/README.org @@ -7,6 +7,7 @@ - [[#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]] * Description @@ -78,12 +79,21 @@ currently supported language: | spanish | | swedish | +** 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 + '((spell-checking :variables =enable-flyspell-auto-completion= t))) +#+END_SRC + * Key Bindings -| 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 | +| 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 | diff --git a/layers/+checkers/spell-checking/config.el b/layers/+checkers/spell-checking/config.el index f404e02a9..96664d22d 100644 --- a/layers/+checkers/spell-checking/config.el +++ b/layers/+checkers/spell-checking/config.el @@ -14,3 +14,6 @@ (defvar spell-checking-enable-auto-dictionary nil "Specify if auto-dictionary should be enabled or not.") + +(defvar enable-flyspell-auto-completion nil + "If not nil, show speeling suggestions in popups.") diff --git a/layers/+checkers/spell-checking/packages.el b/layers/+checkers/spell-checking/packages.el index 87c0eecd9..7d624529d 100644 --- a/layers/+checkers/spell-checking/packages.el +++ b/layers/+checkers/spell-checking/packages.el @@ -14,6 +14,7 @@ auto-dictionary flyspell flyspell-correct + (flyspell-popup :toggle enable-flyspell-auto-completion) )) (defun spell-checking/init-auto-dictionary () @@ -73,3 +74,10 @@ (setq flyspell-correct-interface 'flyspell-correct-helm)) (when (bound-and-true-p flyspell-correct-interface) (spacemacs/set-leader-keys "Sc" 'flyspell-correct-word-generic)))) + +(defun spell-checking/init-flyspell-popup () + (use-package flyspell-popup + :defer t + :init + (progn + (add-hook 'flyspell-mode-hook 'flyspell-popup-auto-correct-mode))))