Emacs: Xah Fly Keys Mode Status Indicator

By Xah Lee. Date: . Last updated: .

This is how you customize Xah Fly Keys command/insert activation status indicator.

change mode indicator in mode line

(setq xah-fly-command-mode-indicator "🔺")
(setq xah-fly-insert-mode-indicator "✏" )

or, you can add background color like this:

(setq xah-fly-command-mode-indicator (propertize "⦿" 'face '(:foreground "red")))

(2023-01-24 thanks to jamesni)

you need proper font setup for unicode. [see Emacs Init: Setup Font]

change current line highlight

(defun my-highlight-line-on () (global-hl-line-mode 1))
(defun my-highlight-line-off () (global-hl-line-mode 0))

(add-hook 'xah-fly-command-mode-activate-hook 'my-highlight-line-on)
(add-hook 'xah-fly-insert-mode-activate-hook  'my-highlight-line-off)

[see Emacs: Hook]

change mode line background color

(defun my-modeline-color-on () (set-face-background 'mode-line "firebrick"))
(defun my-modeline-color-off () (set-face-background 'mode-line "grey"))

(add-hook 'xah-fly-command-mode-activate-hook 'my-modeline-color-on)
(add-hook 'xah-fly-insert-mode-activate-hook  'my-modeline-color-off)

change buffer background color

(defun my-xfk-command-color () (set-background-color "lightgrey"))
(defun my-xfk-insert-color () (set-background-color "white"))

(add-hook 'xah-fly-command-mode-activate-hook 'my-xfk-command-color)
(add-hook 'xah-fly-insert-mode-activate-hook  'my-xfk-insert-color)

See also: Emacs Init: Set Color Theme

2022-01-22 thanks to Christian Tietze https://christiantietze.de/, jamesni, yusz.

emacs, Xah Fly Keys, customization