Add variable spacemacs-evil-cursor-colors

This commit is contained in:
syl20bnr 2015-02-24 00:27:43 -05:00
parent d77bbad49d
commit 48bc6b55f6
2 changed files with 9 additions and 15 deletions

View file

@ -121,7 +121,6 @@ package name does not match theme name + `-theme' suffix.")
" Some processing that needs to be done when the current theme has been
changed to THEME."
(interactive)
;; Define a face for each state
(if (fboundp 'spacemacs/set-state-faces)
(spacemacs/set-state-faces))
(if (fboundp 'spacemacs/set-flycheck-mode-line-faces)

View file

@ -503,6 +503,14 @@ which require an initialization must be listed explicitly in the list.")
(use-package evil
:init
(progn
(defvar spacemacs-evil-cursor-colors '((normal . "DarkGoldenrod2")
(insert . "chartreuse3")
(emacs . "SkyBlue2")
(visual . "gray")
(motion . "plum3")
(lisp . "HotPink1"))
"Colors assigned to evil states.")
(defun spacemacs/state-color-face (state)
"Return the symbol of the face for the given STATE."
(intern (format "spacemacs-%s-face" (symbol-name state))))
@ -540,12 +548,7 @@ which require an initialization must be listed explicitly in the list.")
(defun spacemacs/set-state-faces ()
"Define or set the state faces."
(mapcar (lambda (x) (spacemacs/defface-state-color (car x) (cdr x)))
'((normal . "DarkGoldenrod2")
(insert . "chartreuse3")
(emacs . "SkyBlue2")
(visual . "gray")
(motion . "plum3")
(lisp . "HotPink1"))))
spacemacs-evil-cursor-colors))
(spacemacs/set-state-faces)
(defun set-default-evil-emacs-state-cursor ()
@ -569,14 +572,6 @@ which require an initialization must be listed explicitly in the list.")
(set-default-evil-motion-state-cursor)
(set-default-evil-lisp-state-cursor)
(defun spacemacs/set-evil-cursor-color (state color)
"Change the evil cursor COLOR for STATE."
(let ((face (intern (format "spacemacs-%s-face" (symbol-name state))))
(func (intern (format "set-default-evil-%s-state-cursor"
(symbol-name state)))))
(set-face-attribute face nil :background color)
(funcall func)))
(evil-mode 1))
:config
(progn