[Feature] overwrite-mode indicator.

Close #174.
This commit is contained in:
Vincent Zhang 2019-05-19 04:01:56 +08:00
parent 230ffe8efc
commit ec4e6b932e
3 changed files with 20 additions and 10 deletions

View file

@ -24,8 +24,8 @@ The `doom-modeline` was designed for minimalism, and offers:
- A workspace number segment for `eyebrowse` - A workspace number segment for `eyebrowse`
- A perspective name segment for `persp-mode` - A perspective name segment for `persp-mode`
- A window number segment for `ace-window`, `winum` and `window-numbering` - A window number segment for `ace-window`, `winum` and `window-numbering`
- An indicator for modal editing state, including `evil`, `god`, `ryo` and - An indicator for modal editing state, including `evil`, `overwrite`, `god`,
`xah-fly-keys`, etc. `ryo` and `xah-fly-keys`, etc.
- An indicator for remote host - An indicator for remote host
- An indicator for debug state - An indicator for debug state
- An indicator for current input method - An indicator for current input method

View file

@ -1473,6 +1473,13 @@ mouse-1: Display Line and Column Mode Menu"
((evil-replace-state-p) 'doom-modeline-evil-replace-state)) ((evil-replace-state-p) 'doom-modeline-evil-replace-state))
'mode-line-inactive))))) 'mode-line-inactive)))))
(defsubst doom-modeline--overwrite ()
"The current overwrite state. Requires `overwrite-mode' to be enabled."
(when (bound-and-true-p overwrite-mode)
(propertize " <O> " 'face (if (doom-modeline--active)
'doom-modeline-urgent
'mode-line-inactive))))
(defsubst doom-modeline--god () (defsubst doom-modeline--god ()
"The current god state. Requires `god-mode' to be enabled." "The current god state. Requires `god-mode' to be enabled."
(when (bound-and-true-p god-local-mode) (when (bound-and-true-p god-local-mode)
@ -1490,16 +1497,19 @@ mouse-1: Display Line and Column Mode Menu"
(defsubst doom-modeline--xah-fly-keys () (defsubst doom-modeline--xah-fly-keys ()
"The current `xah-fly-keys' state." "The current `xah-fly-keys' state."
(when (boundp 'xah-fly-insert-state-q) (when (boundp 'xah-fly-insert-state-q)
(propertize (if xah-fly-insert-state-q (let ((active (doom-modeline--active)))
" <I> " (if xah-fly-insert-state-q
" <C> ") (propertize " <I> " 'face (if active
'face (if (doom-modeline--active) 'doom-modeline-evil-insert-state
'mode-line-inactive))
(propertize " <C> " 'face (if active
'doom-modeline-evil-normal-state 'doom-modeline-evil-normal-state
'mode-line-inactive)))) 'mode-line-inactive))))))
(doom-modeline-def-segment modals (doom-modeline-def-segment modals
"Displays modal editing states, including `evil', `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) (concat (doom-modeline--evil)
(doom-modeline--overwrite)
(doom-modeline--god) (doom-modeline--god)
(doom-modeline--ryo) (doom-modeline--ryo)
(doom-modeline--xah-fly-keys))) (doom-modeline--xah-fly-keys)))

View file

@ -45,7 +45,7 @@
;; - A workspace number segment for eyebrowse ;; - A workspace number segment for eyebrowse
;; - A perspective name segment for persp-mode ;; - A perspective name segment for persp-mode
;; - A window number segment for winum and window-numbering ;; - A window number segment for winum and window-numbering
;; - An indicator for modal editing state, including evil, god, ryo and ;; - An indicator for modal editing state, including evil, overwrite, god, ryo and
;; xah-fly-keys, etc. ;; xah-fly-keys, etc.
;; - An indicator for remote host ;; - An indicator for remote host
;; - An indicator for current input method ;; - An indicator for current input method