From c57dd4870a18ced11694f130d75f3f6472d3eb94 Mon Sep 17 00:00:00 2001 From: Francesc Elies Henar Date: Sun, 26 Aug 2018 23:34:34 +0200 Subject: [PATCH] Adds spell checking transient state --- layers/+checkers/spell-checking/README.org | 13 +++++++++++++ layers/+checkers/spell-checking/packages.el | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/layers/+checkers/spell-checking/README.org b/layers/+checkers/spell-checking/README.org index f525fed34..3601dd683 100644 --- a/layers/+checkers/spell-checking/README.org +++ b/layers/+checkers/spell-checking/README.org @@ -11,6 +11,7 @@ - [[#enabling-multi-dictionary-support-with-hunspell][Enabling multi-dictionary support with hunspell]] - [[#enable-auto-completion-popup][Enable auto-completion popup]] - [[#key-bindings][Key Bindings]] + - [[#spell-checking-transient-state][Spell Checking Transient-state]] - [[#known-issues][Known issues]] * Description @@ -127,6 +128,18 @@ set the layer variable =enable-flyspell-auto-completion= to t: | ~SPC S n~ | flyspell goto next error | | ~SPC t S~ | toggle flyspell | +** Spell Checking Transient-state + +| Key Binding | Description | +|-------------+--------------------------------------------------| +| ~SPC g . b~ | Rerun spell check for the whole buffer | +| ~SPC g . d~ | Change dictionary | +| ~SPC g . n~ | Go to next spelling error | +| ~SPC g . c~ | Correct word under cursor | +| ~SPC g . t~ | Toggle spell check | +| ~SPC g . q~ | Quit transient state | +| ~SPC g . Q~ | Quit transient state and disable =flyspell-mode= | + * Known issues Vim-empty-lines layer seems incompatible with spell-checking inside org-mode. If you experience "Args out of range" error message when invoking ~SPC S c~ inside diff --git a/layers/+checkers/spell-checking/packages.el b/layers/+checkers/spell-checking/packages.el index b858d9eb4..da2809725 100644 --- a/layers/+checkers/spell-checking/packages.el +++ b/layers/+checkers/spell-checking/packages.el @@ -44,6 +44,27 @@ :commands (spell-checking/change-dictionary) :init (progn + (spacemacs|define-transient-state spell-checking + :title "Spell Checking Transient State" + :doc " +Spell Commands^^ Other +--------------^^ ----- +[_b_] check whole buffer [_t_] toggle spell check +[_d_] change dictionary [_q_] exit +[_n_] next spell error [_Q_] exit and disable spell check +[_c_] correct word +" + :on-enter (flyspell-mode) + :bindings + ("b" flyspell-buffer) + ("d" spell-checking/change-dictionary) + ("n" flyspell-goto-next-error) + ("c" flyspell-correct-previous-word-generic) + ("Q" flyspell-mode :exit t) + ("q" nil :exit t) + ("t" spacemacs/toggle-spelling-checking)) + + (spacemacs/set-leader-keys "S." 'spacemacs/spell-checking-transient-state/body) (spell-checking/add-flyspell-hook 'text-mode-hook) (when spell-checking-enable-by-default (add-hook 'prog-mode-hook 'flyspell-prog-mode))