From f6bae75bff474633ba28271445dbedec98e57e40 Mon Sep 17 00:00:00 2001 From: Jakub Darul Date: Mon, 24 Aug 2020 20:25:49 +0200 Subject: [PATCH 1/2] Disable spell-fu keybinding if +flyspell enabled --- modules/editor/evil/config.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/editor/evil/config.el b/modules/editor/evil/config.el index d73bd1843..2f9f7f99d 100644 --- a/modules/editor/evil/config.el +++ b/modules/editor/evil/config.el @@ -382,10 +382,12 @@ directives. By default, this only recognizes C directives.") ;; implement dictionary keybinds ;; evil already defines 'z=' to `ispell-word' = correct word at point - :n "zq" #'spell-fu-word-add - :n "zw" #'spell-fu-word-remove - :m "[s" #'spell-fu-goto-previous-error - :m "]s" #'spell-fu-goto-next-error + (:when (not (featurep! :checkers spell +flyspell)) + :n "zq" #'spell-fu-word-add + :n "zw" #'spell-fu-word-remove + :m "[s" #'spell-fu-goto-previous-error + :m "]s" #'spell-fu-goto-next-error + ) ;; ported from vim-unimpaired :n "] SPC" #'+evil/insert-newline-below From 2564bbce0d4aab9134285a9c324f79c45ca673d8 Mon Sep 17 00:00:00 2001 From: Jakub Darul Date: Mon, 24 Aug 2020 20:36:16 +0200 Subject: [PATCH 2/2] Use flyspell-mode for SPC t s if +flyspell present Also corresponding bindigs fix for +emacs-bindigs.el --- modules/config/default/+emacs-bindings.el | 4 +++- modules/config/default/+evil-bindings.el | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/config/default/+emacs-bindings.el b/modules/config/default/+emacs-bindings.el index c9579e258..4c0726df2 100644 --- a/modules/config/default/+emacs-bindings.el +++ b/modules/config/default/+emacs-bindings.el @@ -279,8 +279,10 @@ (:when (featurep! :lang org +present) :desc "org-tree-slide mode" "p" #'org-tree-slide-mode) :desc "Read-only mode" "r" #'read-only-mode - (:when (featurep! :checkers spell) + (:when (and (featurep! :checkers spell) (not (featurep! :checkers spell +flyspell))) :desc "Spell checker" "s" #'spell-fu-mode) + (:when (featurep! :checkers spell +flyspell) + :desc "Spell checker" "s" #'flyspell-mode) (:when (featurep! :lang org +pomodoro) :desc "Pomodoro timer" "t" #'org-pomodoro) (:when (featurep! :ui zen) diff --git a/modules/config/default/+evil-bindings.el b/modules/config/default/+evil-bindings.el index 35adb0e4a..5b6cea3f9 100644 --- a/modules/config/default/+evil-bindings.el +++ b/modules/config/default/+evil-bindings.el @@ -661,8 +661,10 @@ (:when (featurep! :lang org +present) :desc "org-tree-slide mode" "p" #'org-tree-slide-mode) :desc "Read-only mode" "r" #'read-only-mode - (:when (featurep! :checkers spell) + (:when (and (featurep! :checkers spell) (not (featurep! :checkers spell +flyspell))) :desc "Spell checker" "s" #'spell-fu-mode) + (:when (featurep! :checkers spell +flyspell) + :desc "Spell checker" "s" #'flyspell-mode) (:when (featurep! :lang org +pomodoro) :desc "Pomodoro timer" "t" #'org-pomodoro) :desc "Soft line wrapping" "w" #'visual-line-mode