Spray: improve appearance and evil support

This commit is contained in:
TEC 2021-05-01 22:46:25 +08:00
parent 9f3b91011d
commit 5072fe6f9c
Signed by: tec
GPG Key ID: 779591AFDB81F06C
1 changed files with 28 additions and 3 deletions

View File

@ -2317,11 +2317,36 @@ add package src directories to projectile. This isn't desirable in my opinion.
:actions '(insert))
#+end_src
** Spray
Let's make this suit me slightly better.
It would be nice if Spray's default speed suited me better, and the keybindings
worked in evil mode. Let's do that and make the display slightly nicer while
we're at it.
#+begin_src emacs-lisp
(setq spray-wpm 500
spray-height 700)
(use-package! spray
:commands spray-mode
:config
(setq spray-wpm 600
spray-height 800)
(defun spray-mode-hide-cursor ()
"Hide or unhide the cursor as is appropriate."
(if spray-mode
(setq-local spray--last-evil-cursor-state evil-normal-state-cursor
evil-normal-state-cursor '(nil))
(setq-local evil-normal-state-cursor spray--last-evil-cursor-state)))
(add-hook 'spray-mode-hook #'spray-mode-hide-cursor)
(map! :map spray-mode-map
"<return>" #'spray-start/stop
"f" #'spray-faster
"s" #'spray-slower
"t" #'spray-time
"<right>" #'spray-forward-word
"h" #'spray-forward-word
"<left>" #'spray-backward-word
"l" #'spray-backward-word
"q" #'spray-quit))
#+end_src
** Theme magic
Let's automatically update terminals on theme change (as long as ~pywal~ is available).