From d6165e6f3c6f7b9b7aca0c4581ebf695ba102aa4 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Fri, 22 Nov 2019 18:33:21 +0800 Subject: [PATCH] Change doom-modeline-evil-state-icon to doom-modeline-modal-icon. See #265. --- README.md | 5 +-- doom-modeline-core.el | 6 ++-- doom-modeline-segments.el | 70 ++++++++++++++++++++++++--------------- 3 files changed, 50 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 1f69893..9a0a982 100644 --- a/README.md +++ b/README.md @@ -253,8 +253,9 @@ Run `M-x customize-group RET doom-modeline RET` or set the variables. ;; The interval of checking GitHub. (setq doom-modeline-github-interval (* 30 60)) -;; Whether display the `evil' state icon. -(setq doom-modeline-evil-state-icon t) +;; Whether display the modal state icon. +;; Including `evil', `overwrite', `god', `ryo' and `xah-fly-keys', etc. +(setq doom-modeline-modal-icon t) ;; Whether display the mu4e notifications. It requires `mu4e-alert' package. (setq doom-modeline-mu4e t) diff --git a/doom-modeline-core.el b/doom-modeline-core.el index d95b363..aec8e03 100644 --- a/doom-modeline-core.el +++ b/doom-modeline-core.el @@ -309,8 +309,10 @@ It requires `ghub' and `async' packages." :type 'boolean :group 'doom-modeline) -(defcustom doom-modeline-evil-state-icon t - "Whether display the `evil' state icon." +(defcustom doom-modeline-modal-icon t + "Whether display the modal state icon. + +Including `evil', `overwrite', `god', `ryo' and `xah-fly-keys', etc." :type 'boolean :group 'doom-modeline) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index 7e71660..0a45094 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -1530,7 +1530,7 @@ mouse-1: Display Line and Column Mode Menu" (doom-modeline-spc) (doom-modeline-icon 'material - (when doom-modeline-evil-state-icon "fiber_manual_record") + (when doom-modeline-modal-icon "fiber_manual_record") "●" (string-trim (evil-state-property evil-state :tag t)) (if (doom-modeline--active) @@ -1553,11 +1553,14 @@ mouse-1: Display Line and Column Mode Menu" (not (bound-and-true-p evil-local-mode))) (propertize (concat (doom-modeline-spc) - (doom-modeline-icon 'material "fiber_manual_record" "●" "" - (if (doom-modeline--active) - 'doom-modeline-urgent - 'mode-line-inactive) - :v-adjust -0.225) + (doom-modeline-icon + 'material + (when doom-modeline-modal-icon "fiber_manual_record") + "●" "" + (if (doom-modeline--active) + 'doom-modeline-urgent + 'mode-line-inactive) + :v-adjust -0.225) (doom-modeline-spc)) 'help-echo "Overwrite state"))) @@ -1566,11 +1569,14 @@ mouse-1: Display Line and Column Mode Menu" (when (bound-and-true-p god-local-mode) (propertize (concat (doom-modeline-spc) - (doom-modeline-icon 'material "fiber_manual_record" "●" "" - (if (doom-modeline--active) - 'doom-modeline-evil-normal-state - 'mode-line-inactive) - :v-adjust -0.225) + (doom-modeline-icon + 'material + (when doom-modeline-modal-icon "fiber_manual_record") + "●" "" + (if (doom-modeline--active) + 'doom-modeline-evil-normal-state + 'mode-line-inactive) + :v-adjust -0.225) (doom-modeline-spc)) 'help-echo "God mode"))) @@ -1579,11 +1585,14 @@ mouse-1: Display Line and Column Mode Menu" (when (bound-and-true-p ryo-modal-mode) (propertize (concat (doom-modeline-spc) - (doom-modeline-icon 'material "fiber_manual_record" "●" "" - (if (doom-modeline--active) - 'doom-modeline-evil-normal-state - 'mode-line-inactive) - :v-adjust -0.225) + (doom-modeline-icon + 'material + (when doom-modeline-modal-icon "fiber_manual_record") + "●" "" + (if (doom-modeline--active) + 'doom-modeline-evil-normal-state + 'mode-line-inactive) + :v-adjust -0.225) (doom-modeline-spc)) 'help-echo "Ryo modal"))) @@ -1594,25 +1603,32 @@ mouse-1: Display Line and Column Mode Menu" (if xah-fly-insert-state-q (propertize (concat (doom-modeline-spc) - (doom-modeline-icon 'material "fiber_manual_record" "●" "" - (if active - 'doom-modeline-evil-insert-state - 'mode-line-inactive) - :v-adjust -0.225) + (doom-modeline-icon + 'material + (when doom-modeline-modal-icon "fiber_manual_record") + "●" "" + (if active + 'doom-modeline-evil-insert-state + 'mode-line-inactive) + :v-adjust -0.225) (doom-modeline-spc)) 'help-echo "Xah-fly insert state") (propertize (concat (doom-modeline-spc) - (doom-modeline-icon 'material "fiber_manual_record" "●" "" - (if active - 'doom-modeline-evil-normal-state - 'mode-line-inactive) - :v-adjust -0.225) + (doom-modeline-icon + 'material + (when doom-modeline-modal-icon "fiber_manual_record") + "●" "" + (if active + 'doom-modeline-evil-normal-state + 'mode-line-inactive) + :v-adjust -0.225) (doom-modeline-spc)) 'help-echo "Xah-fly normal state"))))) (doom-modeline-def-segment modals - "Displays modal editing states, including `evil', `overwrite', `god', `ryo' and `xha-fly-kyes', etc." + "Displays modal editing states, including `evil', `overwrite', `god', `ryo' +and `xha-fly-kyes', etc." (concat (doom-modeline--evil) (doom-modeline--overwrite) (doom-modeline--god)