Clean up core-evil.el
This commit is contained in:
parent
99375cf001
commit
5954e4ef9e
1 changed files with 14 additions and 36 deletions
|
@ -3,20 +3,8 @@
|
||||||
|
|
||||||
(use-package evil
|
(use-package evil
|
||||||
:init
|
:init
|
||||||
;; highlight matching delimiters where it's important
|
|
||||||
(defun show-paren-mode-off () (show-paren-mode -1))
|
|
||||||
(add-hook! evil-insert-state-entry 'show-paren-mode)
|
|
||||||
(add-hook! evil-insert-state-exit 'show-paren-mode-off)
|
|
||||||
(add-hook! evil-visual-state-entry 'show-paren-mode)
|
|
||||||
(add-hook! evil-visual-state-exit 'show-paren-mode-off)
|
|
||||||
(add-hook! evil-motion-state-entry 'show-paren-mode)
|
|
||||||
(add-hook! evil-motion-state-exit 'show-paren-mode-off)
|
|
||||||
(add-hook! evil-operator-state-entry 'show-paren-mode)
|
|
||||||
(add-hook! evil-operator-state-exit 'show-paren-mode-off)
|
|
||||||
|
|
||||||
;; Disable highlights on insert-mode
|
;; Disable highlights on insert-mode
|
||||||
(add-hook! evil-insert-state-entry 'evil-ex-nohighlight)
|
(add-hook! evil-insert-state-entry 'evil-ex-nohighlight)
|
||||||
|
|
||||||
(add-hook! undo-tree-mode (diminish 'undo-tree-mode))
|
(add-hook! undo-tree-mode (diminish 'undo-tree-mode))
|
||||||
;; Always ensure evil-shift-width is consistent with tab-width
|
;; Always ensure evil-shift-width is consistent with tab-width
|
||||||
(add-hook! evil-local-mode (setq evil-shift-width tab-width))
|
(add-hook! evil-local-mode (setq evil-shift-width tab-width))
|
||||||
|
@ -41,22 +29,13 @@
|
||||||
|
|
||||||
(bind! :map evil-command-window-mode-map :n [escape] 'kill-buffer-and-window)
|
(bind! :map evil-command-window-mode-map :n [escape] 'kill-buffer-and-window)
|
||||||
|
|
||||||
(defadvice evil-ex-hl-do-update-highlight (around evil-ex-hl-shut-up activate)
|
|
||||||
"Silence 'Error running timer `evil-ex-hl-do-update-highlight': (error
|
|
||||||
\"Invalid use of `\\' in replacement text\") errors.
|
|
||||||
|
|
||||||
See https://bitbucket.org/lyro/evil/issue/527"
|
|
||||||
(ignore-errors ad-do-it))
|
|
||||||
|
|
||||||
;; modes to map to different default states
|
;; modes to map to different default states
|
||||||
(dolist (mode-map '((cider-repl-mode . emacs)
|
(dolist (mode-map '((cider-repl-mode . emacs)
|
||||||
(comint-mode . emacs)
|
(comint-mode . emacs)
|
||||||
(term-mode . emacs)
|
(term-mode . emacs)
|
||||||
(fundamental-mode . motion)
|
|
||||||
(help-mode . normal)
|
(help-mode . normal)
|
||||||
(message-mode . normal)
|
(message-mode . normal)
|
||||||
(compilation-mode . normal)
|
(compilation-mode . normal)))
|
||||||
(text-mode . normal)))
|
|
||||||
(evil-set-initial-state `,(car mode-map) `,(cdr mode-map)))
|
(evil-set-initial-state `,(car mode-map) `,(cdr mode-map)))
|
||||||
|
|
||||||
(progn ; evil hacks
|
(progn ; evil hacks
|
||||||
|
@ -74,13 +53,13 @@ See https://bitbucket.org/lyro/evil/issue/527"
|
||||||
(defadvice evil-window-vsplit (after evil-window-vsplit-jump activate)
|
(defadvice evil-window-vsplit (after evil-window-vsplit-jump activate)
|
||||||
(evil-window-right 1))
|
(evil-window-right 1))
|
||||||
|
|
||||||
;; Restore vimmish ex-mode keymaps to isearch
|
;; Restore vimmish ex-mode keymaps in isearch
|
||||||
;; Hide keystroke display while isearch is active
|
;; Hide keystroke display while isearch is active
|
||||||
(add-hook! isearch-mode (setq echo-keystrokes 0))
|
(add-hook! isearch-mode (setq echo-keystrokes 0))
|
||||||
(add-hook! isearch-mode-end (setq echo-keystrokes 0.02))
|
(add-hook! isearch-mode-end (setq echo-keystrokes 0.02))
|
||||||
(bind! :map evil-ex-search-keymap
|
(bind! :map evil-ex-search-keymap
|
||||||
"C-w" 'evil-delete-backward-word
|
"C-w" 'evil-delete-backward-word
|
||||||
"C-u" 'evil-delete-whole-line)))
|
"C-u" 'evil-delete-whole-line)))
|
||||||
|
|
||||||
;; evil plugins
|
;; evil plugins
|
||||||
(use-package evil-anzu)
|
(use-package evil-anzu)
|
||||||
|
@ -105,13 +84,14 @@ See https://bitbucket.org/lyro/evil/issue/527"
|
||||||
:functions (iedit-current-occurrence-string iedit-restrict-region)
|
:functions (iedit-current-occurrence-string iedit-restrict-region)
|
||||||
:commands (evil-iedit-state evil-iedit-state/iedit-mode)
|
:commands (evil-iedit-state evil-iedit-state/iedit-mode)
|
||||||
:config
|
:config
|
||||||
(bind! :map evil-iedit-state-map ; Don't interfere with evil-snipe
|
(bind!
|
||||||
"s" nil
|
:v "SPC" 'narf:iedit-restrict-to-region
|
||||||
"S" nil
|
(:map evil-iedit-state-map ; Don't interfere with evil-snipe
|
||||||
"V" 'evil-visual-line
|
"s" nil
|
||||||
"C" 'evil-iedit-state/substitute ; instead of s/S
|
"S" nil
|
||||||
"za" 'iedit-toggle-unmatched-lines-visible)
|
"V" 'evil-visual-line
|
||||||
(bind! :v "SPC" 'narf:iedit-restrict-to-region))
|
"C" 'evil-iedit-state/substitute ; instead of s/S
|
||||||
|
"za" 'iedit-toggle-unmatched-lines-visible)))
|
||||||
|
|
||||||
(use-package evil-indent-textobject
|
(use-package evil-indent-textobject
|
||||||
:commands (evil-indent-i-indent
|
:commands (evil-indent-i-indent
|
||||||
|
@ -166,14 +146,12 @@ See https://bitbucket.org/lyro/evil/issue/527"
|
||||||
(use-package evil-snipe
|
(use-package evil-snipe
|
||||||
:diminish evil-snipe-mode
|
:diminish evil-snipe-mode
|
||||||
:init
|
:init
|
||||||
(define-key evil-normal-state-map "s" nil)
|
|
||||||
(define-key evil-normal-state-map "S" nil)
|
|
||||||
(setq-default
|
(setq-default
|
||||||
evil-snipe-smart-case t
|
evil-snipe-smart-case t
|
||||||
evil-snipe-repeat-keys nil ;; using evil-space for repeating
|
evil-snipe-repeat-keys nil ; using evil-space to repeat
|
||||||
evil-snipe-scope 'line
|
evil-snipe-scope 'line
|
||||||
evil-snipe-repeat-scope 'buffer
|
evil-snipe-repeat-scope 'buffer
|
||||||
evil-snipe-override-evil-repeat-keys nil
|
evil-snipe-override-evil-repeat-keys nil ; causes problems with remapped ;
|
||||||
evil-snipe-symbol-groups '((?\[ "[[{(]")
|
evil-snipe-symbol-groups '((?\[ "[[{(]")
|
||||||
(?\] "[]})]")))
|
(?\] "[]})]")))
|
||||||
:config
|
:config
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue