2017-06-08 11:47:56 +02:00
|
|
|
;;; feature/evil/config.el -*- lexical-binding: t; -*-
|
2017-02-06 00:25:54 -05:00
|
|
|
|
2017-01-31 19:50:02 -05:00
|
|
|
;; I'm a vimmer at heart. Its modal philosophy suits me better, and this module
|
|
|
|
;; strives to make Emacs a much better vim than vim was.
|
|
|
|
|
2018-08-23 18:42:09 +02:00
|
|
|
(defvar +evil-want-o/O-to-continue-comments t
|
|
|
|
"If non-nil, the o/O keys will continue comment lines if the point is on a
|
|
|
|
line with a linewise comment.")
|
|
|
|
|
2018-06-27 03:09:06 +02:00
|
|
|
;; Set these defaults before `evil'; use `defvar' so they can be changed prior
|
|
|
|
;; to loading.
|
|
|
|
(defvar evil-want-C-u-scroll t)
|
|
|
|
(defvar evil-want-C-w-scroll t)
|
|
|
|
(defvar evil-want-Y-yank-to-eol t)
|
2018-06-26 18:05:35 +02:00
|
|
|
|
2017-06-14 21:03:20 +02:00
|
|
|
(def-package! evil
|
2018-02-03 22:38:07 -05:00
|
|
|
:init
|
2018-06-27 03:09:06 +02:00
|
|
|
(setq evil-want-visual-char-semi-exclusive t
|
2017-01-31 19:50:02 -05:00
|
|
|
evil-magic t
|
|
|
|
evil-echo-state t
|
2017-02-03 19:24:39 -05:00
|
|
|
evil-indent-convert-tabs t
|
2017-01-31 19:50:02 -05:00
|
|
|
evil-ex-search-vim-style-regexp t
|
|
|
|
evil-ex-substitute-global t
|
|
|
|
evil-ex-visual-char-range t ; column range for ex commands
|
2017-02-21 00:47:34 -05:00
|
|
|
evil-insert-skip-empty-lines t
|
2017-05-15 13:52:22 +02:00
|
|
|
evil-mode-line-format 'nil
|
2018-01-09 03:50:51 -05:00
|
|
|
evil-respect-visual-line-mode t
|
2017-05-15 13:52:22 +02:00
|
|
|
;; more vim-like behavior
|
|
|
|
evil-symbol-word-search t
|
2018-02-02 15:11:03 -05:00
|
|
|
;; 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
|
2018-06-25 15:39:38 +02:00
|
|
|
evil-visual-state-cursor 'hollow
|
|
|
|
;; must be set before evil/evil-collection is loaded
|
2018-09-12 21:48:27 -04:00
|
|
|
evil-want-keybinding (not (featurep! +everywhere)))
|
2017-01-31 19:50:02 -05:00
|
|
|
|
2018-02-03 22:38:07 -05:00
|
|
|
:config
|
Introduce general.el & rewrite map!
+ Now uses an overriding keymap for leader keys, so that it is always
available, even outside of normal/visual states. In insert/emacs
states, or in sessions where evil is absent, an alternative prefix is
used for leader/localleader keys. See these variables:
+ doom-leader-prefix
+ doom-leader-alt-prefix
+ doom-localleader-prefix
+ doom-localleader-alt-prefix
+ Keybinds now support alternative prefixes through the new :alt-prefix
property. This is useful for non-evil users and non-normal evil
states. By default, this is M-SPC (leader) and M-SPC m (localleader).
+ Removed +evil-commands flag from config/default (moved to
feature/evil/+commands.el).
+ config/default/+bindings.el has been split into
config/default/+{evil,emacs}-bindings.el, which one is loaded depends
on whether evil is present or not. The latter is blank, but will soon
be populated with a keybinding scheme for non-evil users (perhaps
inspired by #641).
+ The define-key! macro has been replaced; it is now an alias for
general-def.
+ Added unmap! as an alias for general-unbind.
+ The following modifier key conventions are now enforced for
consistency, across all OSes:
alt/option = meta
windows/command = super
It used to be
alt/option = alt
windows/command = meta
Many of the default keybinds have been updated to reflect this switch,
but it is likely to affect personal meta/super keybinds!
The map! macro has also been rewritten to use general-define-key. Here
is what has been changed:
+ map! no longer works with characters, e.g. (map! ?x #'do-something) is
no longer supported. Keys must be kbd-able strings like "C-c x" or
vectors like [?C-c ?x].
+ The :map and :map* properties are now the same thing. If specified
keymaps aren't defined when binding keys, it is automatically
deferred.
+ The way you bind local keybinds has changed:
;; Don't do this
(map! :l "a" #'func-a
:l "b" #'func-b)
;; Do this
(map! :map 'local "a" #'func-a
"b" #'func-b)
+ map! now supports the following new blocks:
+ (:if COND THEN-FORM ELSE-FORM...)
+ (:alt-prefix PREFIX KEYS...) -- this prefix will be used for
non-normal evil states. Equivalent to :non-normal-prefix in general.
+ The way you declare a which-key label for a prefix key has changed:
;; before
(map! :desc "label" :prefix "a" ...)
;; now
(map! :prefix ("a" . "label") ...)
+ It used to be that map! supported binding a key to a key sequence,
like so:
(map! "a" [?x]) ; pressing a is like pressing x
This functionality was removed *temporarily* while I figure out the
implementation.
Addresses: #448, #814, #860
Mentioned in: #940
2018-12-22 03:30:04 -05:00
|
|
|
(load! "+commands")
|
|
|
|
|
2018-05-20 12:21:13 +02:00
|
|
|
(add-hook 'doom-post-init-hook #'evil-mode)
|
2017-02-19 18:14:46 -05:00
|
|
|
(evil-select-search-module 'evil-search-module 'evil-search)
|
|
|
|
|
2018-06-03 15:46:00 +02:00
|
|
|
(put 'evil-define-key* 'lisp-indent-function 'defun)
|
|
|
|
|
2018-08-30 13:14:07 +02:00
|
|
|
(defun +evil|init-popup-rules ()
|
|
|
|
(set-popup-rules!
|
|
|
|
'(("^\\*evil-registers" :size 0.3)
|
|
|
|
("^\\*Command Line" :size 8))))
|
|
|
|
(add-hook 'doom-post-init-hook #'+evil|init-popup-rules)
|
2017-02-21 16:04:35 -05:00
|
|
|
|
2018-02-02 15:11:03 -05:00
|
|
|
;; Change the cursor color in emacs mode
|
2018-09-03 03:25:06 +02:00
|
|
|
(defvar +evil--default-cursor-color
|
|
|
|
(or (ignore-errors (frame-parameter nil 'cursor-color))
|
|
|
|
"#ffffff"))
|
|
|
|
|
2018-02-02 15:11:03 -05:00
|
|
|
(defun +evil-default-cursor () (set-cursor-color +evil--default-cursor-color))
|
|
|
|
(defun +evil-emacs-cursor () (set-cursor-color (face-foreground 'warning)))
|
|
|
|
|
|
|
|
(defun +evil|update-cursor-color ()
|
|
|
|
(setq +evil--default-cursor-color (face-background 'cursor)))
|
2018-03-22 19:28:42 -04:00
|
|
|
(add-hook 'doom-load-theme-hook #'+evil|update-cursor-color)
|
2017-02-19 18:14:46 -05:00
|
|
|
|
2018-06-05 13:23:37 +02:00
|
|
|
(defun +evil|update-shift-width ()
|
|
|
|
(setq evil-shift-width tab-width))
|
|
|
|
(add-hook 'after-change-major-mode-hook #'+evil|update-shift-width t)
|
|
|
|
|
2017-01-31 19:50:02 -05:00
|
|
|
|
2017-05-15 13:52:22 +02:00
|
|
|
;; --- keybind fixes ----------------------
|
2018-06-03 15:46:00 +02:00
|
|
|
(after! wgrep
|
|
|
|
;; A wrapper that invokes `wgrep-mark-deletion' across lines you use
|
|
|
|
;; `evil-delete' in wgrep buffers.
|
2018-06-18 15:02:24 +02:00
|
|
|
(define-key wgrep-mode-map [remap evil-delete] #'+evil-delete))
|
2018-06-03 15:46:00 +02:00
|
|
|
|
2018-01-06 03:00:45 -05:00
|
|
|
(defun +evil|disable-highlights ()
|
|
|
|
"Disable ex search buffer highlights."
|
|
|
|
(when (evil-ex-hl-active-p 'evil-ex-search)
|
|
|
|
(evil-ex-nohighlight)
|
|
|
|
t))
|
|
|
|
(add-hook 'doom-escape-hook #'+evil|disable-highlights)
|
|
|
|
|
2017-05-15 13:52:22 +02:00
|
|
|
|
2018-01-06 18:50:49 -05:00
|
|
|
;; --- evil hacks -------------------------
|
2018-08-30 13:13:32 +02:00
|
|
|
(defun +evil|display-vimlike-save-message ()
|
2018-01-11 13:21:51 -05:00
|
|
|
"Shorter, vim-esque save messages."
|
|
|
|
(message "\"%s\" %dL, %dC written"
|
2018-03-02 20:21:16 -05:00
|
|
|
(if buffer-file-name
|
|
|
|
(file-relative-name (file-truename buffer-file-name) (doom-project-root))
|
|
|
|
(buffer-name))
|
2018-01-11 13:21:51 -05:00
|
|
|
(count-lines (point-min) (point-max))
|
|
|
|
(buffer-size)))
|
2018-05-27 12:47:36 +02:00
|
|
|
(unless noninteractive
|
|
|
|
(setq save-silently t)
|
2018-08-30 13:13:32 +02:00
|
|
|
(add-hook 'after-save-hook #'+evil|display-vimlike-save-message))
|
2018-01-06 18:50:49 -05:00
|
|
|
;; Make ESC (from normal mode) the universal escaper. See `doom-escape-hook'.
|
2018-06-07 02:43:07 +02:00
|
|
|
(advice-add #'evil-force-normal-state :after #'+evil*escape)
|
2018-01-06 18:50:49 -05:00
|
|
|
;; Don't move cursor when indenting
|
2017-05-15 13:52:22 +02:00
|
|
|
(advice-add #'evil-indent :around #'+evil*static-reindent)
|
2018-05-05 07:49:20 +02:00
|
|
|
;; monkey patch `evil-ex-replace-special-filenames' to improve support for
|
|
|
|
;; file modifiers like %:p:h. This adds support for most of vim's modifiers,
|
|
|
|
;; and one custom one: %:P (expand to the project root).
|
2018-01-06 18:50:49 -05:00
|
|
|
(advice-add #'evil-ex-replace-special-filenames :override #'+evil*resolve-vim-path)
|
|
|
|
|
2018-05-05 07:49:20 +02:00
|
|
|
;; make `try-expand-dabbrev' from `hippie-expand' work in minibuffer. See
|
|
|
|
;; `he-dabbrev-beg', so we need to redefine syntax for '/'
|
2018-01-06 18:50:49 -05:00
|
|
|
(defun +evil*fix-dabbrev-in-minibuffer ()
|
|
|
|
(set-syntax-table (let* ((table (make-syntax-table)))
|
|
|
|
(modify-syntax-entry ?/ "." table)
|
|
|
|
table)))
|
|
|
|
(add-hook 'minibuffer-inactive-mode-hook #'+evil*fix-dabbrev-in-minibuffer)
|
|
|
|
|
2018-04-26 22:27:08 -04:00
|
|
|
;; Focus and recenter new splits
|
|
|
|
(advice-add #'evil-window-split :override #'+evil*window-split)
|
|
|
|
(advice-add #'evil-window-vsplit :override #'+evil*window-vsplit)
|
2017-05-15 13:52:22 +02:00
|
|
|
|
2019-02-12 00:53:03 -05:00
|
|
|
;; Integrate evil's jump-list into some navigational commands
|
2018-08-13 14:00:51 +02:00
|
|
|
(defun +evil*set-jump (orig-fn &rest args)
|
|
|
|
"Set a jump point and ensure ORIG-FN doesn't set any new jump points."
|
2019-02-12 00:53:03 -05:00
|
|
|
(evil-set-jump (if (markerp (car args)) (car args)))
|
2018-08-13 14:00:51 +02:00
|
|
|
(let ((evil--jumps-jumping t))
|
|
|
|
(apply orig-fn args)))
|
|
|
|
(advice-add #'counsel-git-grep-action :around #'+evil*set-jump)
|
|
|
|
(advice-add #'helm-ag--find-file-action :around #'+evil*set-jump)
|
2019-02-12 00:53:03 -05:00
|
|
|
(advice-add #'xref-push-marker-stack :around #'+evil*set-jump)
|
2018-06-15 04:45:09 +02:00
|
|
|
|
2018-08-27 21:25:52 +02:00
|
|
|
;; In evil, registers 2-9 are buffer-local. In vim, they're global, so...
|
|
|
|
(defun +evil*make-numbered-markers-global (orig-fn char)
|
|
|
|
(or (and (>= char ?2) (<= char ?9))
|
|
|
|
(funcall orig-fn char)))
|
|
|
|
(advice-add #'evil-global-marker-p :around #'+evil*make-numbered-markers-global)
|
|
|
|
|
2018-09-07 22:02:41 -04:00
|
|
|
;; Make o/O continue comments (see `+evil-want-o/O-to-continue-comments')
|
2018-08-25 17:58:07 +02:00
|
|
|
(advice-add #'evil-open-above :around #'+evil*insert-newline-above-and-respect-comments)
|
|
|
|
(advice-add #'evil-open-below :around #'+evil*insert-newline-below-and-respect-comments)
|
2018-08-23 18:42:09 +02:00
|
|
|
|
2018-06-15 04:45:09 +02:00
|
|
|
;; --- custom interactive codes -----------
|
|
|
|
;; These arg types will highlight matches in the current buffer
|
|
|
|
(evil-ex-define-argument-type buffer-match :runner +evil-ex-buffer-match)
|
|
|
|
(evil-ex-define-argument-type global-match :runner +evil-ex-global-match)
|
|
|
|
;; Other commands can make use of this
|
|
|
|
(evil-define-interactive-code "<//>"
|
|
|
|
:ex-arg buffer-match (list (if (evil-ex-p) evil-ex-argument)))
|
2018-06-27 02:57:02 +02:00
|
|
|
(evil-define-interactive-code "<//g>"
|
|
|
|
:ex-arg global-match (list (if (evil-ex-p) evil-ex-argument)))
|
2018-06-15 04:45:09 +02:00
|
|
|
|
|
|
|
;; By default :g[lobal] doesn't highlight matches in the current buffer. I've
|
|
|
|
;; got to write my own argument type and interactive code to get it to do so.
|
|
|
|
(evil-ex-define-argument-type global-delim-match :runner +evil-ex-global-delim-match)
|
|
|
|
(dolist (sym '(evil-ex-global evil-ex-global-inverted))
|
|
|
|
(evil-set-command-property sym :ex-arg 'global-delim-match))
|
|
|
|
|
|
|
|
;; Forward declare these so that ex completion works, even if the autoloaded
|
|
|
|
;; functions aren't loaded yet.
|
|
|
|
(evil-set-command-properties
|
2018-08-05 22:10:36 +02:00
|
|
|
'+evil:align :move-point t :ex-arg 'buffer-match :ex-bang t :keep-visual t :suppress-operator t)
|
2018-06-25 15:39:38 +02:00
|
|
|
|
|
|
|
;; `evil-collection'
|
|
|
|
(when (featurep! +everywhere)
|
2018-06-27 03:05:47 +02:00
|
|
|
(load! "+everywhere")))
|
2017-02-09 05:09:21 -05:00
|
|
|
|
2017-01-31 19:50:02 -05:00
|
|
|
|
|
|
|
;;
|
2018-09-07 19:36:16 -04:00
|
|
|
;; Packages
|
2017-01-31 19:50:02 -05:00
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! evil-commentary
|
2017-01-31 19:50:02 -05:00
|
|
|
:commands (evil-commentary evil-commentary-yank evil-commentary-line)
|
2017-02-02 04:35:54 -05:00
|
|
|
:config (evil-commentary-mode 1))
|
2017-01-31 19:50:02 -05:00
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! evil-easymotion
|
2018-07-10 14:21:02 +02:00
|
|
|
:commands (evilem-create evilem-default-keybindings)
|
|
|
|
:config
|
|
|
|
;; Use evil-search backend, instead of isearch
|
|
|
|
(evilem-make-motion evilem-motion-search-next #'evil-ex-search-next
|
|
|
|
:bind ((evil-ex-search-highlight-all nil)))
|
|
|
|
(evilem-make-motion evilem-motion-search-previous #'evil-ex-search-previous
|
|
|
|
:bind ((evil-ex-search-highlight-all nil)))
|
|
|
|
|
|
|
|
(evilem-make-motion evilem-motion-search-word-forward #'evil-ex-search-word-forward
|
|
|
|
:bind ((evil-ex-search-highlight-all nil)))
|
|
|
|
(evilem-make-motion evilem-motion-search-word-backward #'evil-ex-search-word-backward
|
|
|
|
:bind ((evil-ex-search-highlight-all nil))))
|
2017-01-31 19:50:02 -05:00
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! evil-embrace
|
2018-01-13 15:30:01 -05:00
|
|
|
:commands (embrace-add-pair embrace-add-pair-regexp)
|
2018-01-14 13:40:11 -05:00
|
|
|
:hook (LaTeX-mode . embrace-LaTeX-mode-hook)
|
|
|
|
:hook (org-mode . embrace-org-mode-hook)
|
2018-01-13 15:30:01 -05:00
|
|
|
:init
|
|
|
|
;; Add extra pairs
|
|
|
|
(add-hook! emacs-lisp-mode
|
|
|
|
(embrace-add-pair ?\` "`" "'"))
|
|
|
|
(add-hook! (emacs-lisp-mode lisp-mode)
|
|
|
|
(embrace-add-pair-regexp ?f "([^ ]+ " ")" #'+evil--embrace-elisp-fn))
|
|
|
|
(add-hook! (org-mode LaTeX-mode)
|
|
|
|
(embrace-add-pair-regexp ?l "\\[a-z]+{" "}" #'+evil--embrace-latex))
|
2019-02-28 18:26:13 -05:00
|
|
|
(after! evil-surround
|
|
|
|
(evil-embrace-enable-evil-surround-integration))
|
2017-01-31 19:50:02 -05:00
|
|
|
:config
|
|
|
|
(setq evil-embrace-show-help-p nil)
|
|
|
|
|
|
|
|
(defun +evil--embrace-get-pair (char)
|
2017-12-10 14:49:52 -05:00
|
|
|
(if-let* ((pair (cdr-safe (assoc (string-to-char char) evil-surround-pairs-alist))))
|
2017-02-19 18:14:46 -05:00
|
|
|
pair
|
2017-12-10 14:49:52 -05:00
|
|
|
(if-let* ((pair (assoc-default char embrace--pairs-list)))
|
|
|
|
(if-let* ((real-pair (and (functionp (embrace-pair-struct-read-function pair))
|
|
|
|
(funcall (embrace-pair-struct-read-function pair)))))
|
2017-02-19 18:14:46 -05:00
|
|
|
real-pair
|
|
|
|
(cons (embrace-pair-struct-left pair) (embrace-pair-struct-right pair)))
|
|
|
|
(cons char char))))
|
2017-01-31 19:50:02 -05:00
|
|
|
|
|
|
|
(defun +evil--embrace-escaped ()
|
|
|
|
"Backslash-escaped surround character support for embrace."
|
|
|
|
(let ((char (read-char "\\")))
|
|
|
|
(if (eq char 27)
|
|
|
|
(cons "" "")
|
|
|
|
(let ((pair (+evil--embrace-get-pair (string char)))
|
|
|
|
(text (if (sp-point-in-string) "\\\\%s" "\\%s")))
|
|
|
|
(cons (format text (car pair))
|
|
|
|
(format text (cdr pair)))))))
|
|
|
|
|
|
|
|
(defun +evil--embrace-latex ()
|
|
|
|
"LaTeX command support for embrace."
|
|
|
|
(cons (format "\\%s{" (read-string "\\")) "}"))
|
|
|
|
|
|
|
|
(defun +evil--embrace-elisp-fn ()
|
|
|
|
"Elisp function support for embrace."
|
|
|
|
(cons (format "(%s " (or (read-string "(") "")) ")"))
|
|
|
|
|
|
|
|
;; Add escaped-sequence support to embrace
|
2018-06-23 16:48:58 +02:00
|
|
|
(setf (alist-get ?\\ (default-value 'embrace--pairs-list))
|
|
|
|
(make-embrace-pair-struct
|
|
|
|
:key ?\\
|
|
|
|
:read-function #'+evil--embrace-escaped
|
|
|
|
:left-regexp "\\[[{(]"
|
|
|
|
:right-regexp "\\[]})]")))
|
2017-01-31 19:50:02 -05:00
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! evil-escape
|
2018-05-14 20:45:47 +02:00
|
|
|
:commands (evil-escape evil-escape-mode evil-escape-pre-command-hook)
|
2017-01-31 19:50:02 -05:00
|
|
|
:init
|
2017-06-09 00:37:02 +02:00
|
|
|
(setq evil-escape-excluded-states '(normal visual multiedit emacs motion)
|
2019-02-13 20:03:03 -05:00
|
|
|
evil-escape-excluded-major-modes '(neotree-mode treemacs-mode term-mode)
|
2017-05-15 13:52:46 +02:00
|
|
|
evil-escape-key-sequence "jk"
|
|
|
|
evil-escape-delay 0.25)
|
2018-05-25 00:46:11 +02:00
|
|
|
(add-hook 'pre-command-hook #'evil-escape-pre-command-hook)
|
2018-06-03 15:46:00 +02:00
|
|
|
(evil-define-key* '(insert replace visual operator) 'global "\C-g" #'evil-escape)
|
2017-01-31 19:50:02 -05:00
|
|
|
:config
|
2017-06-09 00:37:02 +02:00
|
|
|
;; no `evil-escape' in minibuffer
|
2018-09-07 22:03:24 -04:00
|
|
|
(add-hook 'evil-escape-inhibit-functions #'minibufferp)
|
|
|
|
;; so that evil-escape-mode-hook runs, and can be toggled by evil-mc
|
|
|
|
(evil-escape-mode +1))
|
2017-01-31 19:50:02 -05:00
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! evil-exchange
|
2017-01-31 19:50:02 -05:00
|
|
|
:commands evil-exchange
|
|
|
|
:config
|
2017-05-07 19:12:48 +02:00
|
|
|
(defun +evil|escape-exchange ()
|
2017-05-25 12:22:05 +02:00
|
|
|
(when evil-exchange--overlays
|
|
|
|
(evil-exchange-cancel)
|
|
|
|
t))
|
2018-01-06 02:38:34 -05:00
|
|
|
(add-hook 'doom-escape-hook #'+evil|escape-exchange))
|
2017-01-31 19:50:02 -05:00
|
|
|
|
|
|
|
|
2018-01-11 09:17:08 +08:00
|
|
|
(def-package! evil-numbers
|
2018-01-11 11:50:55 +08:00
|
|
|
:commands (evil-numbers/inc-at-pt evil-numbers/dec-at-pt))
|
2018-01-11 09:17:08 +08:00
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! evil-matchit
|
2018-04-17 19:39:56 -04:00
|
|
|
:commands (evilmi-jump-items global-evil-matchit-mode
|
|
|
|
evilmi-outer-text-object evilmi-inner-text-object)
|
2017-01-31 19:50:02 -05:00
|
|
|
:config (global-evil-matchit-mode 1)
|
2017-04-21 15:55:34 -04:00
|
|
|
:init
|
2018-08-28 13:36:44 +02:00
|
|
|
(global-set-key [remap evil-jump-item] #'evilmi-jump-items)
|
2018-06-03 15:46:00 +02:00
|
|
|
(define-key evil-inner-text-objects-map "%" #'evilmi-inner-text-object)
|
|
|
|
(define-key evil-outer-text-objects-map "%" #'evilmi-outer-text-object)
|
2017-05-15 13:52:01 +02:00
|
|
|
:config
|
2018-05-07 21:57:00 +02:00
|
|
|
;; Fixes #519 where d% wouldn't leave a dangling end-parenthesis
|
2018-04-17 19:39:56 -04:00
|
|
|
(evil-set-command-properties 'evilmi-jump-items :type 'inclusive :jump t)
|
2018-05-07 21:57:00 +02:00
|
|
|
|
2017-04-21 15:55:34 -04:00
|
|
|
(defun +evil|simple-matchit ()
|
2017-05-15 13:52:01 +02:00
|
|
|
"A hook to force evil-matchit to favor simple bracket jumping. Helpful when
|
|
|
|
the new algorithm is confusing, like in python or ruby."
|
|
|
|
(setq-local evilmi-always-simple-jump t))
|
|
|
|
(add-hook 'python-mode-hook #'+evil|simple-matchit))
|
2017-01-31 19:50:02 -05:00
|
|
|
|
2017-05-07 19:13:47 +02:00
|
|
|
|
2017-06-20 16:19:40 +02:00
|
|
|
(def-package! evil-snipe
|
2017-07-02 16:53:28 +02:00
|
|
|
:commands (evil-snipe-mode evil-snipe-override-mode
|
|
|
|
evil-snipe-local-mode evil-snipe-override-local-mode)
|
2018-05-25 00:46:11 +02:00
|
|
|
:after-call pre-command-hook
|
2017-01-31 19:50:02 -05:00
|
|
|
:init
|
|
|
|
(setq evil-snipe-smart-case t
|
|
|
|
evil-snipe-scope 'line
|
|
|
|
evil-snipe-repeat-scope 'visible
|
2018-05-30 01:38:36 +02:00
|
|
|
evil-snipe-char-fold t)
|
2018-01-15 00:08:27 -05:00
|
|
|
:config
|
2018-05-29 15:47:17 +02:00
|
|
|
(add-to-list 'evil-snipe-disabled-modes 'Info-mode nil #'eq)
|
2018-05-14 20:45:47 +02:00
|
|
|
(evil-snipe-mode +1)
|
2018-01-15 00:08:27 -05:00
|
|
|
(evil-snipe-override-mode +1))
|
2017-01-31 19:50:02 -05:00
|
|
|
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! evil-surround
|
2017-01-31 19:50:02 -05:00
|
|
|
:commands (global-evil-surround-mode
|
|
|
|
evil-surround-edit
|
|
|
|
evil-Surround-edit
|
|
|
|
evil-surround-region)
|
|
|
|
:config (global-evil-surround-mode 1))
|
|
|
|
|
|
|
|
|
2017-05-15 13:52:01 +02:00
|
|
|
;; Without `evil-visualstar', * and # grab the word at point and search, no
|
|
|
|
;; matter what mode you're in. I want to be able to visually select a region and
|
|
|
|
;; search for other occurrences of it.
|
2017-02-23 00:06:12 -05:00
|
|
|
(def-package! evil-visualstar
|
2018-07-10 14:21:45 +02:00
|
|
|
:commands (evil-visualstar/begin-search
|
2017-01-31 19:50:02 -05:00
|
|
|
evil-visualstar/begin-search-forward
|
|
|
|
evil-visualstar/begin-search-backward)
|
2017-05-15 13:52:01 +02:00
|
|
|
:init
|
2018-06-03 15:46:00 +02:00
|
|
|
(evil-define-key* 'visual 'global
|
|
|
|
"*" #'evil-visualstar/begin-search-forward
|
2018-07-10 14:21:45 +02:00
|
|
|
"#" #'evil-visualstar/begin-search-backward))
|
2017-01-31 19:50:02 -05:00
|
|
|
|
|
|
|
|
2017-06-05 00:47:56 +02:00
|
|
|
;;
|
|
|
|
;; Text object plugins
|
|
|
|
|
2018-06-18 23:46:14 +02:00
|
|
|
(def-package! exato
|
|
|
|
:commands (evil-outer-xml-attr evil-inner-xml-attr))
|