2012-12-18 05:48:12 +00:00
|
|
|
(setq evil-mode-line-format 'before)
|
|
|
|
|
|
|
|
(setq evil-emacs-state-cursor '("red" box))
|
2012-12-19 20:18:17 +00:00
|
|
|
(setq evil-normal-state-cursor '("orange" box))
|
2012-12-30 17:18:08 +00:00
|
|
|
(setq evil-visual-state-cursor '("black" box))
|
2013-04-15 19:53:19 +00:00
|
|
|
(setq evil-insert-state-cursor '("green3" box))
|
2012-12-30 17:18:08 +00:00
|
|
|
(setq evil-motion-state-cursor '("purple" box))
|
2012-12-18 05:48:12 +00:00
|
|
|
|
2013-05-07 00:59:13 +00:00
|
|
|
;; inspired from:
|
|
|
|
;; https://github.com/roman/emacs.d/blob/master/zoo/zoo-evil.el
|
2013-09-04 14:29:48 +00:00
|
|
|
(evil-define-command fd-trigger (callback)
|
|
|
|
"Allows to execute the passed function using 'fd'."
|
2013-05-07 00:32:11 +00:00
|
|
|
:repeat change
|
|
|
|
(let ((modified (buffer-modified-p)))
|
|
|
|
(insert "f")
|
2013-09-04 14:29:48 +00:00
|
|
|
(let ((evt (read-event
|
|
|
|
(format "Insert %c to exit insert state" ?d)
|
|
|
|
nil 0.2)))
|
2013-05-07 00:32:11 +00:00
|
|
|
(cond
|
|
|
|
((null evt)
|
|
|
|
(message ""))
|
|
|
|
((and (integerp evt)
|
|
|
|
(char-equal evt ?d))
|
|
|
|
;; remove the f character
|
|
|
|
(delete-char -1)
|
|
|
|
(set-buffer-modified-p modified)
|
2013-09-04 14:29:48 +00:00
|
|
|
(funcall callback))
|
2013-05-07 00:32:11 +00:00
|
|
|
(t ; otherwise
|
|
|
|
(setq unread-command-events (append unread-command-events
|
|
|
|
(list evt))))))))
|
|
|
|
|
2012-12-18 05:48:12 +00:00
|
|
|
(evil-mode 1)
|
2012-12-29 20:39:39 +00:00
|
|
|
|
|
|
|
;; This is an endless debate and is just a matter of convention
|
|
|
|
;; I prefer to stay on the original character when leaving insert mode
|
2013-01-03 20:36:44 +00:00
|
|
|
;; (initiated with 'i').
|
2012-12-29 20:39:39 +00:00
|
|
|
(setq evil-move-cursor-back nil)
|
2013-01-03 20:36:44 +00:00
|
|
|
|
2013-01-09 19:13:19 +00:00
|
|
|
|