2015-06-06 06:40:33 -04:00
|
|
|
;;; core-evil.el --- the root of all evil
|
|
|
|
|
2015-06-04 18:23:21 -04:00
|
|
|
(use-package evil
|
|
|
|
:init
|
2015-10-15 14:01:53 -04:00
|
|
|
;; Disable highlights on insert-mode
|
2016-04-05 23:58:32 -04:00
|
|
|
(add-hook 'evil-insert-state-entry-hook 'evil-ex-nohighlight)
|
2016-04-23 22:08:46 -04:00
|
|
|
(setq evil-magic t
|
|
|
|
evil-want-C-u-scroll t
|
|
|
|
evil-ex-visual-char-range t ; column range for ex commands
|
|
|
|
evil-want-visual-char-semi-exclusive t
|
|
|
|
evil-ex-search-vim-style-regexp t
|
|
|
|
evil-ex-interactive-search-highlight 'selected-window
|
|
|
|
evil-echo-state nil
|
|
|
|
evil-ex-substitute-global t
|
|
|
|
evil-insert-skip-empty-lines t
|
|
|
|
|
|
|
|
evil-normal-state-tag "N"
|
|
|
|
evil-insert-state-tag "I"
|
|
|
|
evil-visual-state-tag "V"
|
|
|
|
evil-emacs-state-tag "E"
|
|
|
|
evil-operator-state-tag "O"
|
|
|
|
evil-motion-state-tag "M"
|
|
|
|
evil-replace-state-tag "R"
|
|
|
|
|
|
|
|
;; Color-coded state cursors
|
2016-05-20 16:45:37 -04:00
|
|
|
evil-default-cursor (face-attribute 'minibuffer-prompt :foreground nil t)
|
2016-04-23 22:08:46 -04:00
|
|
|
evil-normal-state-cursor 'box
|
2016-05-20 16:45:37 -04:00
|
|
|
evil-emacs-state-cursor `(,(face-attribute 'highlight :foreground nil t) box)
|
2016-04-23 22:08:46 -04:00
|
|
|
evil-insert-state-cursor 'bar
|
|
|
|
evil-visual-state-cursor 'hollow
|
|
|
|
|
|
|
|
;; NOTE: a bug in emacs 25 breaks undoing in evil. See
|
|
|
|
;; https://bitbucket.org/lyro/evil/issues/594/undo-doesnt-behave-like-vim
|
|
|
|
evil-want-fine-undo (if (> emacs-major-version 24) 'fine))
|
2016-01-27 20:08:00 -05:00
|
|
|
|
2016-05-20 19:08:02 -04:00
|
|
|
;; highlight matching delimiters where it's important
|
|
|
|
(defun show-paren-mode-off () (show-paren-mode -1))
|
|
|
|
(add-hook 'evil-insert-state-entry-hook 'show-paren-mode)
|
|
|
|
(add-hook 'evil-insert-state-exit-hook 'show-paren-mode-off)
|
|
|
|
(add-hook 'evil-visual-state-entry-hook 'show-paren-mode)
|
|
|
|
(add-hook 'evil-visual-state-exit-hook 'show-paren-mode-off)
|
|
|
|
(add-hook 'evil-operator-state-entry-hook 'show-paren-mode)
|
|
|
|
(add-hook 'evil-operator-state-exit-hook 'show-paren-mode-off)
|
|
|
|
(add-hook 'evil-normal-state-entry-hook 'show-paren-mode-off)
|
|
|
|
|
2016-04-23 22:08:46 -04:00
|
|
|
:config
|
2015-06-06 06:40:33 -04:00
|
|
|
(evil-mode 1)
|
2016-04-23 22:08:46 -04:00
|
|
|
(evil-select-search-module 'evil-search-module 'evil-search)
|
2016-05-20 19:08:02 -04:00
|
|
|
(mapc (lambda (r) (evil-set-initial-state (car r) (cdr r)))
|
|
|
|
'((compilation-mode . normal)
|
|
|
|
(help-mode . normal)
|
|
|
|
(message-mode . normal)
|
|
|
|
(debugger-mode . normal)
|
|
|
|
(image-mode . normal)
|
|
|
|
(doc-view-mode . normal)
|
|
|
|
(tabulated-list-mode . emacs)
|
|
|
|
(profile-report-mode . emacs)
|
|
|
|
(Info-mode . emacs)
|
|
|
|
(view-mode . emacs)
|
|
|
|
(comint-mode . emacs)
|
|
|
|
(cider-repl-mode . emacs)
|
|
|
|
(term-mode . emacs)
|
|
|
|
(calendar-mode . emacs)
|
|
|
|
(Man-mode . emacs)
|
|
|
|
(grep-mode . emacs)))
|
2015-06-15 09:05:52 +02:00
|
|
|
|
2016-04-19 22:17:03 -04:00
|
|
|
(map! :map evil-command-window-mode-map :n [escape] 'kill-buffer-and-window)
|
2015-06-06 06:40:33 -04:00
|
|
|
|
|
|
|
(progn ; evil hacks
|
2016-05-20 22:37:30 -04:00
|
|
|
(advice-add 'evil-force-normal-state :after 'doom*evil-esc-quit)
|
|
|
|
(defun doom*evil-esc-quit ()
|
2015-11-19 05:55:21 -05:00
|
|
|
"Close popups, disable search highlights and quit the minibuffer if open."
|
2016-05-20 19:08:02 -04:00
|
|
|
(if (eq major-mode 'help-mode)
|
2016-05-20 22:37:30 -04:00
|
|
|
(doom/popup-close)
|
2016-05-20 19:08:02 -04:00
|
|
|
(let ((minib-p (minibuffer-window-active-p (minibuffer-window)))
|
|
|
|
(evil-hl-p (evil-ex-hl-active-p 'evil-ex-search)))
|
|
|
|
(when minib-p (abort-recursive-edit))
|
|
|
|
(when evil-hl-p (evil-ex-nohighlight))
|
2016-05-20 22:37:30 -04:00
|
|
|
;; Close non-repl popups and clean up `doom-popup-windows'
|
2016-05-20 19:08:02 -04:00
|
|
|
(unless (or minib-p evil-hl-p
|
2016-05-20 22:37:30 -04:00
|
|
|
(memq (get-buffer-window) doom-popup-windows))
|
2016-05-20 19:08:02 -04:00
|
|
|
(mapc (lambda (w)
|
|
|
|
(if (window-live-p w)
|
|
|
|
(with-selected-window w
|
|
|
|
(unless (derived-mode-p 'comint-mode)
|
2016-05-20 22:37:30 -04:00
|
|
|
(doom/popup-close w)))
|
|
|
|
(doom/popup-remove w)))
|
|
|
|
doom-popup-windows)))))
|
2015-11-17 02:04:05 -05:00
|
|
|
|
2016-04-19 22:17:03 -04:00
|
|
|
;; Fix harmless (yet disruptive) error reporting w/ hidden buffers caused by
|
|
|
|
;; workgroups killing windows
|
2016-04-10 18:47:07 -04:00
|
|
|
;; TODO Delete timer on dead windows
|
2016-05-12 22:11:43 -04:00
|
|
|
(defadvice evil-ex-hl-do-update-highlight
|
|
|
|
(around evil-ex-hidden-buffer-ignore-errors activate)
|
2016-04-10 18:47:07 -04:00
|
|
|
(ignore-errors ad-do-it))
|
|
|
|
|
2015-06-15 09:05:52 +02:00
|
|
|
;; Hide keystroke display while isearch is active
|
|
|
|
(add-hook! isearch-mode (setq echo-keystrokes 0))
|
|
|
|
(add-hook! isearch-mode-end (setq echo-keystrokes 0.02))
|
2015-10-28 03:31:51 -04:00
|
|
|
|
2015-10-25 00:39:22 -04:00
|
|
|
(after! evil-snipe
|
2016-04-23 22:08:46 -04:00
|
|
|
(def-repeat! evil-snipe-f evil-snipe-repeat evil-snipe-repeat-reverse)
|
|
|
|
(def-repeat! evil-snipe-F evil-snipe-repeat evil-snipe-repeat-reverse)
|
|
|
|
(def-repeat! evil-snipe-t evil-snipe-repeat evil-snipe-repeat-reverse)
|
|
|
|
(def-repeat! evil-snipe-T evil-snipe-repeat evil-snipe-repeat-reverse)
|
|
|
|
(def-repeat! evil-snipe-s evil-snipe-repeat evil-snipe-repeat-reverse)
|
|
|
|
(def-repeat! evil-snipe-S evil-snipe-repeat evil-snipe-repeat-reverse)
|
|
|
|
(def-repeat! evil-snipe-x evil-snipe-repeat evil-snipe-repeat-reverse)
|
|
|
|
(def-repeat! evil-snipe-X evil-snipe-repeat evil-snipe-repeat-reverse))
|
2015-10-25 00:39:22 -04:00
|
|
|
|
|
|
|
(after! evil-visualstar
|
2016-05-12 22:11:43 -04:00
|
|
|
(def-repeat! evil-visualstar/begin-search-forward
|
|
|
|
evil-ex-search-next evil-ex-search-previous)
|
|
|
|
(def-repeat! evil-visualstar/begin-search-backward
|
|
|
|
evil-ex-search-previous evil-ex-search-next))
|
2016-04-19 22:08:18 -04:00
|
|
|
|
2016-04-23 22:08:46 -04:00
|
|
|
(def-repeat! evil-ex-search-next evil-ex-search-next evil-ex-search-previous)
|
|
|
|
(def-repeat! evil-ex-search-previous evil-ex-search-next evil-ex-search-previous)
|
|
|
|
(def-repeat! evil-ex-search-forward evil-ex-search-next evil-ex-search-previous)
|
|
|
|
(def-repeat! evil-ex-search-backward evil-ex-search-next evil-ex-search-previous)
|
2016-04-19 22:08:18 -04:00
|
|
|
|
|
|
|
;; A monkey patch to add all of vim's file ex substitution flags to evil-mode.
|
2015-11-17 02:04:30 -05:00
|
|
|
(defun evil-ex-replace-special-filenames (file-name)
|
|
|
|
"Replace special symbols in FILE-NAME."
|
2016-04-19 22:08:18 -04:00
|
|
|
(let ((case-fold-search nil)
|
|
|
|
(regexp (concat "\\(?:^\\|[^\\\\]\\)"
|
|
|
|
"\\([#%@]\\)"
|
|
|
|
"\\(\\(?::\\(?:[phtreS~.]\\|g?s[^: $]+\\)\\)*\\)")))
|
|
|
|
(dolist (match (s-match-strings-all regexp file-name))
|
|
|
|
(let ((flags (split-string (caddr match) ":" t))
|
|
|
|
(path (file-relative-name
|
|
|
|
(pcase (cadr match)
|
2016-05-20 22:37:30 -04:00
|
|
|
("@" (doom/project-root))
|
2016-04-19 22:08:18 -04:00
|
|
|
("%" (buffer-file-name))
|
|
|
|
("#" (and (other-buffer) (buffer-file-name (other-buffer)))))
|
|
|
|
default-directory))
|
|
|
|
flag global)
|
|
|
|
(when path
|
|
|
|
(while flags
|
|
|
|
(setq flag (pop flags))
|
|
|
|
(when (string-suffix-p "\\" flag)
|
|
|
|
(setq flag (concat flag (pop flags))))
|
|
|
|
(when (string-prefix-p "gs" flag)
|
|
|
|
(setq global t flag (string-remove-prefix "g" flag)))
|
|
|
|
(setq path
|
|
|
|
(or (pcase (substring flag 0 1)
|
|
|
|
("p" (expand-file-name path))
|
|
|
|
("~" (file-relative-name path "~"))
|
|
|
|
("." (file-relative-name path default-directory))
|
|
|
|
("h" (directory-file-name path))
|
|
|
|
("t" (file-name-nondirectory (directory-file-name path)))
|
|
|
|
("r" (file-name-sans-extension path))
|
|
|
|
("e" (file-name-extension path))
|
|
|
|
("s" (let* ((args (evil-delimited-arguments (substring flag 1) 2))
|
|
|
|
(pattern (evil-transform-vim-style-regexp (car args)))
|
|
|
|
(replace (cadr args)))
|
|
|
|
(replace-regexp-in-string
|
|
|
|
(if global pattern (concat "\\(" pattern "\\).*\\'"))
|
|
|
|
(evil-transform-vim-style-regexp replace) path t t
|
|
|
|
(unless global 1))))
|
|
|
|
("S" (shell-quote-argument path))
|
|
|
|
(t path))
|
|
|
|
"")))
|
|
|
|
(setq file-name
|
|
|
|
(replace-regexp-in-string (format "\\(?:^\\|[^\\\\]\\)\\(%s\\)"
|
|
|
|
(string-trim-left (car match)))
|
|
|
|
path file-name t t 1)))))
|
|
|
|
;; Clean up
|
|
|
|
(setq file-name (replace-regexp-in-string regexp "\\1" file-name t)))))
|
2015-12-11 02:21:49 -05:00
|
|
|
|
2016-05-20 19:08:02 -04:00
|
|
|
;; Extra argument types for highlight buffer (or global) regexp matches
|
2016-05-20 22:37:30 -04:00
|
|
|
(evil-ex-define-argument-type buffer-match :runner doom/evil-ex-buffer-match)
|
|
|
|
(evil-ex-define-argument-type global-match :runner doom/evil-ex-global-match)
|
2015-12-11 16:51:04 -05:00
|
|
|
|
2015-12-11 02:21:49 -05:00
|
|
|
(evil-define-interactive-code "<//>"
|
|
|
|
:ex-arg buffer-match
|
|
|
|
(list (when (evil-ex-p) evil-ex-argument)))
|
2015-12-11 16:51:04 -05:00
|
|
|
(evil-define-interactive-code "<g//>"
|
2015-12-11 02:21:49 -05:00
|
|
|
:ex-arg global-match
|
2016-05-20 19:08:02 -04:00
|
|
|
(when (evil-ex-p) (evil-ex-parse-global evil-ex-argument))))
|
2015-06-15 09:05:52 +02:00
|
|
|
|
|
|
|
;; evil plugins
|
2016-05-20 19:08:02 -04:00
|
|
|
(use-package evil-numbers
|
|
|
|
:commands (evil-numbers/inc-at-pt evil-numbers/dec-at-pt))
|
|
|
|
|
2015-10-15 14:01:53 -04:00
|
|
|
(use-package evil-anzu
|
2015-11-18 15:22:00 -05:00
|
|
|
:config
|
|
|
|
(setq anzu-cons-mode-line-p nil
|
2016-05-01 01:06:56 -04:00
|
|
|
anzu-minimum-input-length 1
|
|
|
|
anzu-search-threshold 250))
|
2015-10-15 14:01:53 -04:00
|
|
|
|
|
|
|
(use-package evil-args
|
|
|
|
:commands (evil-inner-arg evil-outer-arg evil-forward-arg evil-backward-arg evil-jump-out-args)
|
2016-05-20 19:08:02 -04:00
|
|
|
:init (def-text-obj! "a" 'evil-inner-arg 'evil-outer-arg))
|
2015-06-15 09:05:52 +02:00
|
|
|
|
|
|
|
(use-package evil-commentary
|
2016-04-16 21:27:59 -04:00
|
|
|
:commands (evil-commentary evil-commentary-yank evil-commentary-line)
|
2015-06-15 09:05:52 +02:00
|
|
|
:config (evil-commentary-mode 1))
|
|
|
|
|
|
|
|
(use-package evil-exchange
|
|
|
|
:commands evil-exchange
|
2016-05-20 22:37:30 -04:00
|
|
|
:config (advice-add 'evil-force-normal-state :after 'doom*evil-exchange-off))
|
2015-06-15 09:05:52 +02:00
|
|
|
|
2016-02-20 16:16:01 -05:00
|
|
|
(use-package evil-multiedit
|
|
|
|
:commands (evil-multiedit-match-all
|
|
|
|
evil-multiedit-match-and-next
|
|
|
|
evil-multiedit-match-and-prev
|
|
|
|
evil-multiedit-toggle-or-restrict-region
|
|
|
|
evil-multiedit-next
|
|
|
|
evil-multiedit-prev
|
2016-03-23 11:49:13 -04:00
|
|
|
evil-multiedit-abort
|
|
|
|
evil-multiedit-ex-match)
|
2015-06-15 09:05:52 +02:00
|
|
|
:config
|
2016-05-20 19:08:02 -04:00
|
|
|
(map! :map evil-multiedit-state-map
|
|
|
|
"RET" 'evil-multiedit-toggle-or-restrict-region
|
|
|
|
"C-n" 'evil-multiedit-next
|
|
|
|
"C-p" 'evil-multiedit-prev
|
|
|
|
:map evil-multiedit-insert-state-map
|
|
|
|
"C-n" 'evil-multiedit-next
|
|
|
|
"C-p" 'evil-multiedit-prev))
|
2015-11-09 15:55:03 -05:00
|
|
|
|
|
|
|
(use-package evil-indent-plus
|
2016-03-03 15:05:38 -05:00
|
|
|
:commands (evil-indent-plus-i-indent
|
|
|
|
evil-indent-plus-a-indent
|
|
|
|
evil-indent-plus-i-indent-up
|
|
|
|
evil-indent-plus-a-indent-up
|
|
|
|
evil-indent-plus-i-indent-up-down
|
|
|
|
evil-indent-plus-a-indent-up-down)
|
|
|
|
:init
|
2016-05-20 19:08:02 -04:00
|
|
|
(def-text-obj! "i" 'evil-indent-plus-i-indent 'evil-indent-plus-a-indent)
|
|
|
|
(def-text-obj! "I" 'evil-indent-plus-i-indent-up 'evil-indent-plus-a-indent-up)
|
|
|
|
(def-text-obj! "J" 'evil-indent-plus-i-indent-up-down 'evil-indent-plus-a-indent-up-down))
|
2015-06-04 18:23:21 -04:00
|
|
|
|
2015-06-15 09:05:52 +02:00
|
|
|
(use-package evil-matchit
|
2015-10-15 14:01:53 -04:00
|
|
|
:commands (evilmi-jump-items evilmi-text-object global-evil-matchit-mode)
|
|
|
|
:config (global-evil-matchit-mode 1)
|
2016-05-20 19:08:02 -04:00
|
|
|
:init (def-text-obj! "%" 'evilmi-text-object))
|
2016-04-10 18:48:05 -04:00
|
|
|
|
|
|
|
(use-package evil-textobj-anyblock
|
|
|
|
:commands (evil-textobj-anyblock-inner-block evil-textobj-anyblock-a-block)
|
2016-05-20 19:08:02 -04:00
|
|
|
:init (def-text-obj! "B" 'evil-textobj-anyblock-inner-block 'evil-textobj-anyblock-a-block))
|
2016-04-10 18:48:05 -04:00
|
|
|
|
|
|
|
(use-package evil-search-highlight-persist
|
|
|
|
:config
|
|
|
|
(global-evil-search-highlight-persist t)
|
|
|
|
(advice-add 'evil-force-normal-state :after 'evil-search-highlight-persist-remove-all))
|
|
|
|
|
2016-02-18 03:40:22 -05:00
|
|
|
(use-package evil-easymotion
|
|
|
|
:defer 1
|
2016-05-20 22:37:30 -04:00
|
|
|
:init (defvar doom--evil-snipe-repeat-fn)
|
2016-02-18 03:40:22 -05:00
|
|
|
:config
|
|
|
|
(evilem-default-keybindings "g SPC")
|
|
|
|
(evilem-define (kbd "g SPC n") 'evil-ex-search-next)
|
|
|
|
(evilem-define (kbd "g SPC N") 'evil-ex-search-previous)
|
|
|
|
(evilem-define "gs" 'evil-snipe-repeat
|
2016-03-03 15:05:26 -05:00
|
|
|
:pre-hook (save-excursion (call-interactively #'evil-snipe-s))
|
|
|
|
:bind ((evil-snipe-scope 'buffer)
|
|
|
|
(evil-snipe-enable-highlight)
|
|
|
|
(evil-snipe-enable-incremental-highlight)))
|
2016-02-18 03:40:22 -05:00
|
|
|
(evilem-define "gS" 'evil-snipe-repeat-reverse
|
2016-03-03 15:05:26 -05:00
|
|
|
:pre-hook (save-excursion (call-interactively #'evil-snipe-s))
|
|
|
|
:bind ((evil-snipe-scope 'buffer)
|
|
|
|
(evil-snipe-enable-highlight)
|
2016-04-10 18:48:05 -04:00
|
|
|
(evil-snipe-enable-incremental-highlight)))
|
2015-11-09 15:55:03 -05:00
|
|
|
|
2016-05-20 22:37:30 -04:00
|
|
|
(setq doom--evil-snipe-repeat-fn
|
2016-04-10 18:48:05 -04:00
|
|
|
(evilem-create 'evil-snipe-repeat
|
|
|
|
:bind ((evil-snipe-scope 'whole-buffer)
|
|
|
|
(evil-snipe-enable-highlight)
|
|
|
|
(evil-snipe-enable-incremental-highlight)))))
|
2015-06-15 09:05:52 +02:00
|
|
|
|
|
|
|
(use-package evil-snipe
|
|
|
|
:init
|
|
|
|
(setq-default
|
|
|
|
evil-snipe-smart-case t
|
2015-10-28 17:26:54 -04:00
|
|
|
evil-snipe-repeat-keys nil ; using space to repeat
|
2015-06-15 09:05:52 +02:00
|
|
|
evil-snipe-scope 'line
|
2015-10-15 14:01:53 -04:00
|
|
|
evil-snipe-repeat-scope 'visible
|
2015-09-29 09:53:45 -04:00
|
|
|
evil-snipe-override-evil-repeat-keys nil ; causes problems with remapped ;
|
2016-04-19 03:12:41 -04:00
|
|
|
evil-snipe-aliases '((?\[ "[[{(]")
|
|
|
|
(?\] "[]})]")
|
|
|
|
(?\; "[;:]")))
|
2015-08-12 15:05:40 +02:00
|
|
|
:config
|
2015-06-15 09:05:52 +02:00
|
|
|
(evil-snipe-mode 1)
|
2016-04-10 18:48:05 -04:00
|
|
|
(evil-snipe-override-mode 1)
|
2016-05-20 22:37:30 -04:00
|
|
|
(define-key evil-snipe-parent-transient-map (kbd "C-;") 'doom/evil-snipe-easymotion))
|
2015-06-15 09:05:52 +02:00
|
|
|
|
|
|
|
(use-package evil-surround
|
|
|
|
:commands (global-evil-surround-mode
|
|
|
|
evil-surround-edit
|
|
|
|
evil-Surround-edit
|
|
|
|
evil-surround-region)
|
|
|
|
:config
|
2016-05-07 22:04:20 -04:00
|
|
|
(global-evil-surround-mode 1))
|
2015-06-15 09:05:52 +02:00
|
|
|
|
2016-05-01 00:59:10 -04:00
|
|
|
(use-package evil-embrace
|
|
|
|
:after evil-surround
|
|
|
|
:config
|
2016-05-20 16:46:13 -04:00
|
|
|
(setq evil-embrace-show-help-p nil)
|
2016-05-01 00:59:10 -04:00
|
|
|
(evil-embrace-enable-evil-surround-integration)
|
2016-05-07 22:04:20 -04:00
|
|
|
(add-hook 'LaTeX-mode-hook 'embrace-LaTeX-mode-hook)
|
|
|
|
(add-hook 'org-mode-hook 'embrace-org-mode-hook)
|
2016-05-20 16:46:13 -04:00
|
|
|
(add-hook! (text-mode prog-mode)
|
|
|
|
;; Escaped surround characters
|
2016-05-20 22:37:30 -04:00
|
|
|
(embrace-add-pair-regexp ?\\ "\\[[{(]" "\\[]})]" 'doom/embrace-escaped))
|
2016-05-07 22:04:20 -04:00
|
|
|
(add-hook! emacs-lisp-mode
|
|
|
|
(embrace-add-pair ?\` "`" "'"))
|
|
|
|
(add-hook! (emacs-lisp-mode lisp-mode)
|
2016-05-20 22:37:30 -04:00
|
|
|
(embrace-add-pair-regexp ?f "([^ ]+ " ")" 'doom/embrace-elisp-fn))
|
2016-05-07 22:04:20 -04:00
|
|
|
(add-hook! (org-mode latex-mode)
|
2016-05-20 22:37:30 -04:00
|
|
|
(embrace-add-pair-regexp ?l "\\[a-z]+{" "}" 'doom/embrace-latex)))
|
2016-05-01 00:59:10 -04:00
|
|
|
|
2015-06-15 09:05:52 +02:00
|
|
|
(use-package evil-visualstar
|
|
|
|
:commands (global-evil-visualstar-mode
|
|
|
|
evil-visualstar/begin-search
|
|
|
|
evil-visualstar/begin-search-forward
|
|
|
|
evil-visualstar/begin-search-backward)
|
|
|
|
:config
|
|
|
|
(global-evil-visualstar-mode 1))
|
2015-06-04 18:23:21 -04:00
|
|
|
|
2016-04-04 12:06:34 -04:00
|
|
|
(use-package evil-escape
|
|
|
|
:config
|
2016-04-05 23:58:32 -04:00
|
|
|
(setq evil-escape-key-sequence "jk"
|
2016-04-19 22:17:03 -04:00
|
|
|
evil-escape-delay 0.25)
|
2016-04-23 22:08:46 -04:00
|
|
|
(evil-escape-mode +1)
|
2016-04-07 06:31:45 -04:00
|
|
|
|
2016-04-23 22:08:46 -04:00
|
|
|
;; evil-escape causes noticable lag in linewise motions in visual mode, so disable it in
|
|
|
|
;; visual mode
|
2016-05-20 22:37:30 -04:00
|
|
|
(defun doom|evil-escape-disable () (evil-escape-mode -1))
|
|
|
|
(defun doom|evil-escape-enable () (evil-escape-mode +1))
|
|
|
|
(add-hook 'evil-visual-state-entry-hook 'doom|evil-escape-disable)
|
|
|
|
(add-hook 'evil-visual-state-exit-hook 'doom|evil-escape-enable)
|
|
|
|
(add-hook 'evil-insert-state-exit-hook 'doom|evil-escape-enable)
|
2016-05-01 00:59:21 -04:00
|
|
|
|
|
|
|
(push 'neotree-mode evil-escape-excluded-major-modes))
|
2016-04-04 12:06:34 -04:00
|
|
|
|
2015-06-04 18:23:21 -04:00
|
|
|
(provide 'core-evil)
|
|
|
|
;;; core-evil.el ends here
|