Last active
November 25, 2018 22:18
-
-
Save gcentauri/ebff7221e9679229c8993e753d478118 to your computer and use it in GitHub Desktop.
elisp config for xah-fly-keys and alternate modeline behavior
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-package xah-fly-keys | |
:diminish (xah-fly-keys . "∑") | |
:init | |
(setq xah-fly-use-control-key nil) | |
(defun xfk-command-mode-on () | |
(global-hl-line-mode 1) | |
(set-cursor-color "deep pink") | |
(setq cursor-type 'box) | |
) | |
(defun xfk-insert-mode-on () | |
(global-hl-line-mode 0) | |
(set-cursor-color "Dark Turquoise") | |
(setq cursor-type 'hbar) | |
) | |
:config | |
;; comment out for default dvorak layout | |
(xah-fly-keys-set-layout "qwerty") ; required if you use qwerty | |
(message "activating xah-fly-keys") | |
(xah-fly-keys 1) | |
(add-hook 'xah-fly-command-mode-activate-hook 'xfk-command-mode-on) | |
(add-hook 'xah-fly-insert-mode-activate-hook 'xfk-insert-mode-on) | |
(add-hook 'magit-mode-hook 'xah-fly-insert-mode-activate) | |
(add-hook 'magit-popup-mode-hook 'xah-fly-insert-mode-activate) | |
) | |
(defface my-spaceline-modified | |
`((t (:background "deep pink" | |
:foreground "#FFFFFF" | |
:inherit 'mode-line))) | |
"spaceline highlight face for modified buffers." | |
:group 'spaceline) | |
(defface my-spaceline-unmodified | |
`((t (:background "Dark Turquoise" | |
:foreground "#3E3D31" | |
:inherit 'mode-line))) | |
"spaceline highlight face for unmodified buffers." | |
:group 'spaceline) | |
(defun my-spaceline-highlight-face-modified () | |
"Set the highlight face depending on the buffer modified status. | |
Set `spaceline-highlight-face-func' to | |
`spaceline-highlight-face-modified' to use this." | |
(cond | |
(buffer-read-only 'spaceline-read-only) | |
((buffer-modified-p) 'my-spaceline-modified) | |
(t 'my-spaceline-unmodified))) | |
(setq spaceline-highlight-face-func 'my-spaceline-highlight-face-modified) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
put this in your dotspacemacs/user-config if you want to try it out