From f853124578c5e6faa7c169378bbcd7f9335f80c6 Mon Sep 17 00:00:00 2001 From: duianto Date: Sat, 13 Mar 2021 09:04:01 +0100 Subject: [PATCH] Improve editing-style toggles problem: The toggle editing style prefix: SPC t E always shows the same names: e -> emacs (holy-mode) h -> hybrid (hybrid-mode) This causes some confusion about how to switch to the vim (evil-mode) editing style, from emacs or hybrid state. solution: Show which editing styles one will switch to: In evil-mode: e -> emacs (holy-mode) h -> hybrid (hybrid-mode) In holy-mode: e -> vim (evil-mode) h -> hybrid (hybrid-mode) In hybrid-mode: e -> emacs (holy-mode) h -> vim (evil-mode) --- .../spacemacs-bootstrap/packages.el | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/layers/+distributions/spacemacs-bootstrap/packages.el b/layers/+distributions/spacemacs-bootstrap/packages.el index 93fed61cc..0a89adf74 100644 --- a/layers/+distributions/spacemacs-bootstrap/packages.el +++ b/layers/+distributions/spacemacs-bootstrap/packages.el @@ -592,9 +592,13 @@ Press \\[which-key-toggle-persistent] to hide." (spacemacs|add-toggle holy-mode :status holy-mode :on (progn (when (bound-and-true-p hybrid-mode) - (hybrid-mode -1)) - (holy-mode)) - :off (holy-mode -1) + (hybrid-mode -1) + (spacemacs/declare-prefix "tEh" "hybrid (hybrid-mode)")) + (holy-mode) + (spacemacs/declare-prefix "tEe" "vim (evil-mode")) + :off (progn (holy-mode -1) + (spacemacs/declare-prefix "tEe" "emacs (holy-mode)")) + :off-message "evil-mode enabled." :documentation "Globally toggle holy mode." :evil-leader "tEe") (spacemacs|diminish holy-mode " Ⓔe" " Ee"))))) @@ -608,9 +612,13 @@ Press \\[which-key-toggle-persistent] to hide." (spacemacs|add-toggle hybrid-mode :status hybrid-mode :on (progn (when (bound-and-true-p holy-mode) - (holy-mode -1)) - (hybrid-mode)) - :off (hybrid-mode -1) + (holy-mode -1) + (spacemacs/declare-prefix "tEe" "emacs (holy-mode)")) + (hybrid-mode) + (spacemacs/declare-prefix "tEh" "vim (evil-mode)")) + :off (progn (hybrid-mode -1) + (spacemacs/declare-prefix "tEh" "hybrid (hybrid-mode)")) + :off-message "evil-mode enabled." :documentation "Globally toggle hybrid mode." :evil-leader "tEh") (spacemacs|diminish hybrid-mode " Ⓔh" " Eh")))))