feature/evil: don't override user cursor settings
Slightly more flexible. If you change the evil cursors, but want to retain the color changes, you'll need to make `evil-default-cursor` and `evil-emacs-state-cursor` into lists and add `+evil-default-cursor` and `+evil-emacs-cursor` to them, respectively.
This commit is contained in:
parent
b9d8116734
commit
c4244de05e
1 changed files with 15 additions and 9 deletions
|
@ -37,7 +37,13 @@
|
||||||
;; more vim-like behavior
|
;; more vim-like behavior
|
||||||
evil-symbol-word-search t
|
evil-symbol-word-search t
|
||||||
;; don't activate mark on shift-click
|
;; don't activate mark on shift-click
|
||||||
shift-select-mode nil)
|
shift-select-mode nil
|
||||||
|
;; cursor appearance
|
||||||
|
evil-default-cursor '+evil-default-cursor
|
||||||
|
evil-normal-state-cursor 'box
|
||||||
|
evil-emacs-state-cursor '(box +evil-emacs-cursor)
|
||||||
|
evil-insert-state-cursor 'bar
|
||||||
|
evil-visual-state-cursor 'hollow)
|
||||||
|
|
||||||
(add-hook 'doom-init-hook #'evil-mode)
|
(add-hook 'doom-init-hook #'evil-mode)
|
||||||
(evil-select-search-module 'evil-search-module 'evil-search)
|
(evil-select-search-module 'evil-search-module 'evil-search)
|
||||||
|
@ -45,14 +51,14 @@
|
||||||
(set! :popup "^\\*evil-registers" '((size . 0.3)))
|
(set! :popup "^\\*evil-registers" '((size . 0.3)))
|
||||||
(set! :popup "^\\*Command Line" '((size . 8)))
|
(set! :popup "^\\*Command Line" '((size . 8)))
|
||||||
|
|
||||||
;; Set cursor colors later, once theme is loaded
|
;; Change the cursor color in emacs mode
|
||||||
(defun +evil*init-cursors (&rest _)
|
(defvar +evil--default-cursor-color "#ffffff")
|
||||||
(setq evil-default-cursor (face-background 'cursor nil t)
|
(defun +evil-default-cursor () (set-cursor-color +evil--default-cursor-color))
|
||||||
evil-normal-state-cursor 'box
|
(defun +evil-emacs-cursor () (set-cursor-color (face-foreground 'warning)))
|
||||||
evil-emacs-state-cursor `(,(face-foreground 'warning) box)
|
|
||||||
evil-insert-state-cursor 'bar
|
(defun +evil|update-cursor-color ()
|
||||||
evil-visual-state-cursor 'hollow))
|
(setq +evil--default-cursor-color (face-background 'cursor)))
|
||||||
(advice-add #'load-theme :after #'+evil*init-cursors)
|
(add-hook 'doom-init-theme-hook #'+evil|update-cursor-color)
|
||||||
|
|
||||||
;; default modes
|
;; default modes
|
||||||
(dolist (mode '(tabulated-list-mode view-mode comint-mode term-mode calendar-mode Man-mode))
|
(dolist (mode '(tabulated-list-mode view-mode comint-mode term-mode calendar-mode Man-mode))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue