2019-04-21 19:59:44 -04:00
|
|
|
;;; editor/evil/config.el -*- lexical-binding: t; -*-
|
2017-02-06 00:25:54 -05:00
|
|
|
|
2019-10-26 21:34:44 -04:00
|
|
|
(defvar +evil-repeat-keys (cons ";" ",")
|
|
|
|
"The keys to use for universal repeating motions.
|
|
|
|
|
|
|
|
This is a cons cell whose CAR is the key for repeating a motion forward, and
|
2020-08-04 18:10:00 -04:00
|
|
|
whose CDR is for repeating backward. They should both be `kbd'-able strings.
|
|
|
|
|
|
|
|
Set this to `nil' to disable universal-repeating on these keys.")
|
2019-10-26 21:34:44 -04:00
|
|
|
|
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.")
|
|
|
|
|
2019-06-17 12:37:19 +02:00
|
|
|
(defvar +evil-preprocessor-regexp "^\\s-*#[a-zA-Z0-9_]"
|
|
|
|
"The regexp used by `+evil/next-preproc-directive' and
|
|
|
|
`+evil/previous-preproc-directive' on ]# and [#, to jump between preprocessor
|
|
|
|
directives. By default, this only recognizes C directives.")
|
|
|
|
|
2018-06-27 03:09:06 +02:00
|
|
|
;; Set these defaults before `evil'; use `defvar' so they can be changed prior
|
|
|
|
;; to loading.
|
2020-05-18 17:17:11 -04:00
|
|
|
(defvar evil-want-C-g-bindings t)
|
2020-12-14 15:48:29 -05:00
|
|
|
(defvar evil-want-C-i-jump nil) ; we do this ourselves
|
2019-12-21 14:58:40 -05:00
|
|
|
(defvar evil-want-C-u-scroll t) ; moved the universal arg to <leader> u
|
2019-12-21 03:28:07 -05:00
|
|
|
(defvar evil-want-C-u-delete t)
|
2018-06-27 03:09:06 +02:00
|
|
|
(defvar evil-want-C-w-scroll t)
|
2019-12-21 03:39:19 -05:00
|
|
|
(defvar evil-want-C-w-delete t)
|
2018-06-27 03:09:06 +02:00
|
|
|
(defvar evil-want-Y-yank-to-eol t)
|
2019-08-19 12:48:36 -04:00
|
|
|
(defvar evil-want-abbrev-expand-on-insert-exit nil)
|
2021-05-10 03:12:31 -04:00
|
|
|
(defvar evil-respect-visual-line-mode nil)
|
2018-06-26 18:05:35 +02:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! evil
|
2019-03-04 20:35:47 -05:00
|
|
|
:hook (doom-init-modules . evil-mode)
|
|
|
|
:demand t
|
|
|
|
:preface
|
2021-04-29 18:17:00 -04:00
|
|
|
(setq evil-ex-search-vim-style-regexp t
|
2017-01-31 19:50:02 -05:00
|
|
|
evil-ex-visual-char-range t ; column range for ex commands
|
2017-05-15 13:52:22 +02:00
|
|
|
evil-mode-line-format 'nil
|
|
|
|
;; more vim-like behavior
|
|
|
|
evil-symbol-word-search t
|
2018-02-02 15:11:03 -05:00
|
|
|
;; cursor appearance
|
2019-07-18 15:27:20 +02:00
|
|
|
evil-default-cursor '+evil-default-cursor-fn
|
2018-02-02 15:11:03 -05:00
|
|
|
evil-normal-state-cursor 'box
|
2019-07-18 15:27:20 +02:00
|
|
|
evil-emacs-state-cursor '(box +evil-emacs-cursor-fn)
|
2018-02-02 15:11:03 -05:00
|
|
|
evil-insert-state-cursor 'bar
|
2018-06-25 15:39:38 +02:00
|
|
|
evil-visual-state-cursor 'hollow
|
2019-12-15 23:52:17 -05:00
|
|
|
;; Only do highlighting in selected window so that Emacs has less work
|
|
|
|
;; to do highlighting them all.
|
2020-08-05 20:50:05 -04:00
|
|
|
evil-ex-interactive-search-highlight 'selected-window
|
|
|
|
;; It's infuriating that innocuous "beginning of line" or "end of line"
|
|
|
|
;; errors will abort macros, so suppress them:
|
2020-10-09 04:41:45 -04:00
|
|
|
evil-kbd-macro-suppress-motion-error t
|
|
|
|
evil-undo-system
|
|
|
|
(cond ((featurep! :emacs undo +tree) 'undo-tree)
|
|
|
|
((featurep! :emacs undo) 'undo-fu)
|
|
|
|
(EMACS28+ 'undo-redo)))
|
2017-01-31 19:50:02 -05:00
|
|
|
|
2019-12-20 14:03:45 -05:00
|
|
|
;; Slow this down from 0.02 to prevent blocking in large or folded buffers
|
|
|
|
;; like magit while incrementally highlighting matches.
|
2020-08-08 03:06:26 -04:00
|
|
|
(setq-hook! '(magit-mode-hook so-long-minor-mode-hook)
|
|
|
|
evil-ex-hl-update-delay 0.25)
|
2019-12-20 14:03:45 -05:00
|
|
|
|
2018-02-03 22:38:07 -05:00
|
|
|
:config
|
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)
|
|
|
|
|
2019-07-21 04:02:09 +02:00
|
|
|
;; stop copying each visual state move to the clipboard:
|
2021-01-13 01:13:38 -05:00
|
|
|
;; https://github.com/emacs-evil/evil/issues/336
|
2019-07-21 04:02:09 +02:00
|
|
|
;; grokked from:
|
|
|
|
;; http://stackoverflow.com/questions/15873346/elisp-rename-macro
|
|
|
|
(advice-add #'evil-visual-update-x-selection :override #'ignore)
|
|
|
|
|
2019-05-14 22:26:56 -04:00
|
|
|
;; Start help-with-tutorial in emacs state
|
|
|
|
(advice-add #'help-with-tutorial :after (lambda (&rest _) (evil-emacs-state +1)))
|
|
|
|
|
2019-03-04 20:35:47 -05:00
|
|
|
;; Done in a hook to ensure the popup rules load as late as possible
|
2019-07-26 22:46:05 +02:00
|
|
|
(add-hook! 'doom-init-modules-hook
|
2019-07-18 15:27:20 +02:00
|
|
|
(defun +evil--init-popup-rules-h ()
|
|
|
|
(set-popup-rules!
|
|
|
|
'(("^\\*evil-registers" :size 0.3)
|
|
|
|
("^\\*Command Line" :size 8)))))
|
2017-02-21 16:04:35 -05:00
|
|
|
|
2019-05-17 20:45:23 -04:00
|
|
|
;; Change the cursor color in emacs state. We do it this roundabout way
|
|
|
|
;; instead of changing `evil-default-cursor' (or `evil-emacs-state-cursor') so
|
|
|
|
;; it won't interfere with users who have changed these variables.
|
|
|
|
(defvar +evil--default-cursor-color "#ffffff")
|
|
|
|
(defvar +evil--emacs-cursor-color "#ff9999")
|
2018-02-02 15:11:03 -05:00
|
|
|
|
2020-11-21 01:38:33 -05:00
|
|
|
(add-hook! 'doom-load-theme-hook
|
2019-07-18 15:27:20 +02:00
|
|
|
(defun +evil-update-cursor-color-h ()
|
|
|
|
(setq +evil--default-cursor-color (face-background 'cursor)
|
|
|
|
+evil--emacs-cursor-color (face-foreground 'warning))))
|
2019-05-17 20:45:23 -04:00
|
|
|
|
2019-07-18 15:27:20 +02:00
|
|
|
(defun +evil-default-cursor-fn ()
|
2019-05-17 20:45:23 -04:00
|
|
|
(evil-set-cursor-color +evil--default-cursor-color))
|
2019-07-18 15:27:20 +02:00
|
|
|
(defun +evil-emacs-cursor-fn ()
|
2019-05-17 20:45:23 -04:00
|
|
|
(evil-set-cursor-color +evil--emacs-cursor-color))
|
2017-02-19 18:14:46 -05:00
|
|
|
|
2019-07-18 15:27:20 +02:00
|
|
|
(setq-hook! 'after-change-major-mode-hook evil-shift-width tab-width)
|
2018-06-05 13:23:37 +02:00
|
|
|
|
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
|
|
|
|
2019-07-26 22:46:05 +02:00
|
|
|
(add-hook! 'doom-escape-hook
|
2019-07-18 15:27:20 +02:00
|
|
|
(defun +evil-disable-ex-highlights-h ()
|
|
|
|
"Disable ex search buffer highlights."
|
|
|
|
(when (evil-ex-hl-active-p 'evil-ex-search)
|
|
|
|
(evil-ex-nohighlight)
|
|
|
|
t)))
|
2018-01-06 03:00:45 -05:00
|
|
|
|
2017-05-15 13:52:22 +02:00
|
|
|
|
2018-01-06 18:50:49 -05:00
|
|
|
;; --- evil hacks -------------------------
|
2020-12-02 17:38:49 -05:00
|
|
|
(after! eldoc
|
|
|
|
;; Allow eldoc to trigger directly after changing modes
|
|
|
|
(eldoc-add-command 'evil-normal-state
|
|
|
|
'evil-insert
|
|
|
|
'evil-change
|
|
|
|
'evil-delete
|
|
|
|
'evil-replace))
|
|
|
|
|
2018-05-27 12:47:36 +02:00
|
|
|
(unless noninteractive
|
|
|
|
(setq save-silently t)
|
2019-07-26 22:46:05 +02:00
|
|
|
(add-hook! 'after-save-hook
|
2019-07-18 15:27:20 +02:00
|
|
|
(defun +evil-display-vimlike-save-message-h ()
|
|
|
|
"Shorter, vim-esque save messages."
|
|
|
|
(message "\"%s\" %dL, %dC written"
|
|
|
|
(if buffer-file-name
|
|
|
|
(file-relative-name (file-truename buffer-file-name) (doom-project-root))
|
|
|
|
(buffer-name))
|
|
|
|
(count-lines (point-min) (point-max))
|
|
|
|
(buffer-size)))))
|
2019-10-28 23:04:12 -04:00
|
|
|
|
2020-02-23 15:41:49 -05:00
|
|
|
;; HACK '=' moves the cursor to the beginning of selection. Disable this,
|
|
|
|
;; since it's more disruptive than helpful.
|
2019-10-28 23:04:12 -04:00
|
|
|
(defadvice! +evil--dont-move-cursor-a (orig-fn &rest args)
|
|
|
|
:around #'evil-indent
|
|
|
|
(save-excursion (apply orig-fn args)))
|
|
|
|
|
2020-02-23 15:41:49 -05:00
|
|
|
;; REVIEW In evil, registers 2-9 are buffer-local. In vim, they're global,
|
|
|
|
;; so... Perhaps this should be PRed upstream?
|
2020-01-28 16:52:13 -05:00
|
|
|
(defadvice! +evil--make-numbered-markers-global-a (char)
|
2019-10-28 23:04:12 -04:00
|
|
|
:after-until #'evil-global-marker-p
|
|
|
|
(and (>= char ?2) (<= char ?9)))
|
|
|
|
|
2020-02-23 15:41:49 -05:00
|
|
|
;; REVIEW Fix #2493: dir-locals cannot target fundamental-mode when evil-mode
|
2020-05-15 01:44:53 -04:00
|
|
|
;; is active. See hlissner/doom-emacs#2493. Revert this if
|
|
|
|
;; emacs-evil/evil#1268 is resolved upstream.
|
2020-02-23 15:41:49 -05:00
|
|
|
(defadvice! +evil--fix-local-vars-a (&rest _)
|
|
|
|
:before #'turn-on-evil-mode
|
|
|
|
(when (eq major-mode 'fundamental-mode)
|
|
|
|
(hack-local-variables)))
|
|
|
|
|
2020-04-17 23:08:17 -04:00
|
|
|
;; HACK Invoking helpful from evil-ex throws a "No recursive edit is in
|
|
|
|
;; progress" error because, between evil-ex and helpful,
|
|
|
|
;; `abort-recursive-edit' gets called one time too many.
|
|
|
|
(defadvice! +evil--fix-helpful-key-in-evil-ex-a (key-sequence)
|
|
|
|
:before #'helpful-key
|
|
|
|
(when (evil-ex-p)
|
|
|
|
(run-at-time 0.1 nil #'helpful-key key-sequence)
|
|
|
|
(abort-recursive-edit)))
|
|
|
|
|
2020-08-08 14:05:08 -04:00
|
|
|
;; Make J (evil-join) remove comment delimiters when joining lines.
|
2021-02-25 13:51:05 -05:00
|
|
|
(advice-add #'evil-join :around #'+evil-join-a)
|
2020-08-08 14:05:08 -04:00
|
|
|
|
2020-08-24 01:32:38 -04:00
|
|
|
;; Prevent gw (`evil-fill') and gq (`evil-fill-and-move') from squeezing
|
|
|
|
;; spaces. It doesn't in vim, so it shouldn't in evil.
|
|
|
|
(defadvice! +evil--no-squeeze-on-fill-a (orig-fn &rest args)
|
|
|
|
:around '(evil-fill evil-fill-and-move)
|
|
|
|
(letf! (defun fill-region (from to &optional justify nosqueeze to-eop)
|
|
|
|
(funcall fill-region from to justify t to-eop))
|
|
|
|
(apply orig-fn args)))
|
|
|
|
|
2018-01-06 18:50:49 -05:00
|
|
|
;; Make ESC (from normal mode) the universal escaper. See `doom-escape-hook'.
|
:boom: revise advice naming convention (1/2)
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.
In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.
doom*shut-up -> doom-shut-up-a
doom*recenter -> doom-recenter-a
+evil*static-reindent -> +evil--static-reindent-a
The rationale behind this change is:
1. Elisp's own formatting/indenting tools would occasionally struggle
with | and * (particularly pp and cl-prettyprint). They have no
problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
github markdown) struggle with it, sometimes refusing to highlight
code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
on haphazardly way back when Doom was simply "my private config".
Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.
Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
macro. The old pair weren't as useful. The new def-advice! saves on a
lot of space.
- Removed "stage" assertions to make sure you were using the right
macros in the right place. Turned out to not be necessary, we'll
employ better checks later.
2019-07-18 15:42:52 +02:00
|
|
|
(advice-add #'evil-force-normal-state :after #'+evil-escape-a)
|
2019-10-28 23:04:12 -04:00
|
|
|
|
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).
|
2020-04-26 04:12:33 -04:00
|
|
|
(advice-add #'evil-ex-replace-special-filenames :override #'+evil-replace-filename-modifiers-a)
|
2018-01-06 18:50:49 -05:00
|
|
|
|
2019-03-04 20:42:04 -05:00
|
|
|
;; make `try-expand-dabbrev' (from `hippie-expand') work in minibuffer
|
2019-07-18 15:27:20 +02:00
|
|
|
(add-hook 'minibuffer-inactive-mode-hook #'+evil--fix-dabbrev-in-minibuffer-h)
|
2018-01-06 18:50:49 -05:00
|
|
|
|
2018-04-26 22:27:08 -04:00
|
|
|
;; Focus and recenter new splits
|
:boom: revise advice naming convention (1/2)
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.
In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.
doom*shut-up -> doom-shut-up-a
doom*recenter -> doom-recenter-a
+evil*static-reindent -> +evil--static-reindent-a
The rationale behind this change is:
1. Elisp's own formatting/indenting tools would occasionally struggle
with | and * (particularly pp and cl-prettyprint). They have no
problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
github markdown) struggle with it, sometimes refusing to highlight
code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
on haphazardly way back when Doom was simply "my private config".
Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.
Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
macro. The old pair weren't as useful. The new def-advice! saves on a
lot of space.
- Removed "stage" assertions to make sure you were using the right
macros in the right place. Turned out to not be necessary, we'll
employ better checks later.
2019-07-18 15:42:52 +02:00
|
|
|
(advice-add #'evil-window-split :override #'+evil-window-split-a)
|
|
|
|
(advice-add #'evil-window-vsplit :override #'+evil-window-vsplit-a)
|
2017-05-15 13:52:22 +02:00
|
|
|
|
2020-02-28 16:29:49 -05:00
|
|
|
;; Make o/O continue comments (see `+evil-want-o/O-to-continue-comments' to disable)
|
:boom: revise advice naming convention (1/2)
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.
In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.
doom*shut-up -> doom-shut-up-a
doom*recenter -> doom-recenter-a
+evil*static-reindent -> +evil--static-reindent-a
The rationale behind this change is:
1. Elisp's own formatting/indenting tools would occasionally struggle
with | and * (particularly pp and cl-prettyprint). They have no
problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
github markdown) struggle with it, sometimes refusing to highlight
code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
on haphazardly way back when Doom was simply "my private config".
Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.
Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
macro. The old pair weren't as useful. The new def-advice! saves on a
lot of space.
- Removed "stage" assertions to make sure you were using the right
macros in the right place. Turned out to not be necessary, we'll
employ better checks later.
2019-07-18 15:42:52 +02:00
|
|
|
(advice-add #'evil-open-above :around #'+evil--insert-newline-above-and-respect-comments-a)
|
|
|
|
(advice-add #'evil-open-below :around #'+evil--insert-newline-below-and-respect-comments-a)
|
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
|
2019-08-15 14:58:41 -04:00
|
|
|
(evil-ex-define-argument-type regexp-match
|
|
|
|
:runner (lambda (flag &optional arg) (+evil-ex-regexp-match flag arg 'inverted)))
|
|
|
|
(evil-ex-define-argument-type regexp-global-match
|
|
|
|
:runner +evil-ex-regexp-match)
|
|
|
|
|
|
|
|
(defun +evil--regexp-match-args (arg)
|
|
|
|
(when (evil-ex-p)
|
|
|
|
(cl-destructuring-bind (&optional arg flags)
|
|
|
|
(evil-delimited-arguments arg 2)
|
|
|
|
(list arg (string-to-list flags)))))
|
|
|
|
|
2018-06-15 04:45:09 +02:00
|
|
|
;; Other commands can make use of this
|
|
|
|
(evil-define-interactive-code "<//>"
|
2019-08-15 14:58:41 -04:00
|
|
|
:ex-arg regexp-match
|
|
|
|
(+evil--regexp-match-args evil-ex-argument))
|
2018-06-15 04:45:09 +02:00
|
|
|
|
2019-08-15 14:58:41 -04:00
|
|
|
(evil-define-interactive-code "<//!>"
|
|
|
|
:ex-arg regexp-global-match
|
|
|
|
(+evil--regexp-match-args evil-ex-argument))
|
2018-06-15 04:45:09 +02:00
|
|
|
|
|
|
|
;; Forward declare these so that ex completion works, even if the autoloaded
|
|
|
|
;; functions aren't loaded yet.
|
2019-08-15 14:58:41 -04:00
|
|
|
(evil-add-command-properties '+evil:align :ex-arg 'regexp-match)
|
|
|
|
(evil-add-command-properties '+evil:align-right :ex-arg 'regexp-match)
|
|
|
|
(evil-add-command-properties '+multiple-cursors:evil-mc :ex-arg 'regexp-global-match)
|
2018-06-25 15:39:38 +02:00
|
|
|
|
2019-08-15 14:58:41 -04:00
|
|
|
;; Lazy load evil ex commands
|
|
|
|
(delq! 'evil-ex features)
|
|
|
|
(add-transient-hook! 'evil-ex (provide 'evil-ex))
|
|
|
|
(after! evil-ex (load! "+commands")))
|
2017-02-09 05:09:21 -05:00
|
|
|
|
2017-01-31 19:50:02 -05:00
|
|
|
|
|
|
|
;;
|
2019-10-10 12:33:09 -04:00
|
|
|
;;; Packages
|
2017-01-31 19:50:02 -05:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! evil-easymotion
|
2020-10-15 16:02:12 -04:00
|
|
|
:after-call doom-first-input-hook
|
2019-07-21 23:31:42 +02:00
|
|
|
:commands evilem-create evilem-default-keybindings
|
2018-07-10 14:21:02 +02:00
|
|
|
: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
|
2020-10-15 16:02:12 -04:00
|
|
|
:bind ((evil-ex-search-highlight-all nil)))
|
|
|
|
|
|
|
|
;; Rebind scope of w/W/e/E/ge/gE evil-easymotion motions to the visible
|
|
|
|
;; buffer, rather than just the current line.
|
|
|
|
(put 'visible 'bounds-of-thing-at-point (lambda () (cons (window-start) (window-end))))
|
|
|
|
(evilem-make-motion evilem-motion-forward-word-begin #'evil-forward-word-begin :scope 'visible)
|
|
|
|
(evilem-make-motion evilem-motion-forward-WORD-begin #'evil-forward-WORD-begin :scope 'visible)
|
|
|
|
(evilem-make-motion evilem-motion-forward-word-end #'evil-forward-word-end :scope 'visible)
|
|
|
|
(evilem-make-motion evilem-motion-forward-WORD-end #'evil-forward-WORD-end :scope 'visible)
|
|
|
|
(evilem-make-motion evilem-motion-backward-word-begin #'evil-backward-word-begin :scope 'visible)
|
|
|
|
(evilem-make-motion evilem-motion-backward-WORD-begin #'evil-backward-WORD-begin :scope 'visible)
|
|
|
|
(evilem-make-motion evilem-motion-backward-word-end #'evil-backward-word-end :scope 'visible)
|
|
|
|
(evilem-make-motion evilem-motion-backward-WORD-end #'evil-backward-WORD-end :scope 'visible))
|
2017-01-31 19:50:02 -05:00
|
|
|
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! evil-embrace
|
2019-07-21 23:31:42 +02:00
|
|
|
:commands embrace-add-pair embrace-add-pair-regexp
|
2018-01-14 13:40:11 -05:00
|
|
|
:hook (LaTeX-mode . embrace-LaTeX-mode-hook)
|
2020-05-15 01:44:53 -04:00
|
|
|
:hook (LaTeX-mode . +evil-embrace-latex-mode-hook-h)
|
2018-01-14 13:40:11 -05:00
|
|
|
:hook (org-mode . embrace-org-mode-hook)
|
2020-03-12 11:29:54 -04:00
|
|
|
:hook (ruby-mode . embrace-ruby-mode-hook)
|
2019-03-04 14:23:12 -05:00
|
|
|
:hook (emacs-lisp-mode . embrace-emacs-lisp-mode-hook)
|
2020-02-22 18:16:25 -06:00
|
|
|
:hook ((lisp-mode emacs-lisp-mode clojure-mode racket-mode hy-mode)
|
2019-07-18 15:27:20 +02:00
|
|
|
. +evil-embrace-lisp-mode-hook-h)
|
2020-01-06 22:44:31 -05:00
|
|
|
:hook ((c++-mode rustic-mode csharp-mode java-mode swift-mode typescript-mode)
|
2019-07-18 15:27:20 +02:00
|
|
|
. +evil-embrace-angle-bracket-modes-hook-h)
|
2020-05-28 04:40:02 -04:00
|
|
|
:hook (scala-mode . +evil-embrace-scala-mode-hook-h)
|
2018-01-13 15:30:01 -05:00
|
|
|
:init
|
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)
|
|
|
|
|
2020-05-28 04:40:02 -04:00
|
|
|
(defun +evil-embrace-scala-mode-hook-h ()
|
|
|
|
(embrace-add-pair ?$ "${" "}"))
|
|
|
|
|
2019-07-18 15:27:20 +02:00
|
|
|
(defun +evil-embrace-latex-mode-hook-h ()
|
2019-03-04 14:23:12 -05:00
|
|
|
(embrace-add-pair-regexp ?l "\\[a-z]+{" "}" #'+evil--embrace-latex))
|
|
|
|
|
2019-07-18 15:27:20 +02:00
|
|
|
(defun +evil-embrace-lisp-mode-hook-h ()
|
2020-01-06 22:44:31 -05:00
|
|
|
;; Avoid `embrace-add-pair-regexp' because it would overwrite the default
|
|
|
|
;; `f' rule, which we want for other modes
|
2019-03-28 16:41:21 -04:00
|
|
|
(push (cons ?f (make-embrace-pair-struct
|
|
|
|
:key ?f
|
|
|
|
:read-function #'+evil--embrace-elisp-fn
|
|
|
|
:left-regexp "([^ ]+ "
|
|
|
|
:right-regexp ")"))
|
|
|
|
embrace--pairs-list))
|
2017-01-31 19:50:02 -05:00
|
|
|
|
2019-07-18 15:27:20 +02:00
|
|
|
(defun +evil-embrace-angle-bracket-modes-hook-h ()
|
2020-01-06 22:44:31 -05:00
|
|
|
(let ((var (make-local-variable 'evil-embrace-evil-surround-keys)))
|
|
|
|
(set var (delq ?< evil-embrace-evil-surround-keys))
|
|
|
|
(set var (delq ?> evil-embrace-evil-surround-keys)))
|
|
|
|
(embrace-add-pair-regexp ?< "\\_<[a-z0-9-_]+<" ">" #'+evil--embrace-angle-brackets)
|
|
|
|
(embrace-add-pair ?> "<" ">"))
|
2019-07-12 01:07:23 +02:00
|
|
|
|
2017-01-31 19:50:02 -05:00
|
|
|
;; 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
|
|
|
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! evil-escape
|
2019-07-21 23:31:42 +02:00
|
|
|
:commands evil-escape
|
2019-09-09 23:00:44 -04:00
|
|
|
:after-call 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-06-19 14:12:47 +02:00
|
|
|
evil-escape-excluded-major-modes '(neotree-mode treemacs-mode vterm-mode)
|
2017-05-15 13:52:46 +02:00
|
|
|
evil-escape-key-sequence "jk"
|
2019-09-20 23:55:25 -04:00
|
|
|
evil-escape-delay 0.15)
|
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
|
2020-05-01 18:39:40 -04:00
|
|
|
;; no `evil-escape' in minibuffer, unless `evil-collection-setup-minibuffer'
|
|
|
|
;; is enabled, where we could be in insert mode in the minibuffer.
|
|
|
|
(add-hook! 'evil-escape-inhibit-functions
|
|
|
|
(defun +evil-inhibit-escape-in-minibuffer-fn ()
|
|
|
|
(and (minibufferp)
|
|
|
|
(or (not (bound-and-true-p evil-collection-setup-minibuffer))
|
|
|
|
(evil-normal-state-p)))))
|
2018-09-07 22:03:24 -04:00
|
|
|
;; 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
|
|
|
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! evil-exchange
|
2017-01-31 19:50:02 -05:00
|
|
|
:commands evil-exchange
|
|
|
|
:config
|
2019-07-26 22:46:05 +02:00
|
|
|
(add-hook! 'doom-escape-hook
|
2019-07-18 15:27:20 +02:00
|
|
|
(defun +evil--escape-exchange-h ()
|
|
|
|
(when evil-exchange--overlays
|
|
|
|
(evil-exchange-cancel)
|
|
|
|
t))))
|
2017-01-31 19:50:02 -05:00
|
|
|
|
2019-12-01 05:07:55 -05:00
|
|
|
|
2019-12-01 14:37:17 +07:00
|
|
|
(use-package! evil-quick-diff
|
|
|
|
:commands (evil-quick-diff evil-quick-diff-cancel))
|
2017-01-31 19:50:02 -05:00
|
|
|
|
2019-12-01 05:07:55 -05:00
|
|
|
|
2019-10-10 12:33:09 -04:00
|
|
|
(use-package! evil-nerd-commenter
|
|
|
|
:commands (evilnc-comment-operator
|
|
|
|
evilnc-inner-comment
|
2020-10-20 16:52:48 -04:00
|
|
|
evilnc-outer-commenter)
|
|
|
|
:general ([remap comment-line] #'evilnc-comment-or-uncomment-lines))
|
2019-10-10 12:33:09 -04:00
|
|
|
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! evil-snipe
|
2019-07-21 23:31:42 +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
|
2020-07-22 20:53:50 -04:00
|
|
|
(pushnew! evil-snipe-disabled-modes 'Info-mode 'calc-mode 'treemacs-mode)
|
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
|
|
|
|
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-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))
|
|
|
|
|
|
|
|
|
2020-10-27 23:20:22 -04:00
|
|
|
(use-package! evil-textobj-anyblock
|
|
|
|
:defer t
|
|
|
|
:config
|
|
|
|
(setq evil-textobj-anyblock-blocks
|
|
|
|
'(("(" . ")")
|
|
|
|
("{" . "}")
|
|
|
|
("\\[" . "\\]")
|
|
|
|
("<" . ">"))))
|
|
|
|
|
|
|
|
|
2019-08-15 14:58:41 -04:00
|
|
|
(use-package! evil-traces
|
|
|
|
:after evil-ex
|
|
|
|
:config
|
|
|
|
(pushnew! evil-traces-argument-type-alist
|
|
|
|
'(+evil:align . evil-traces-global)
|
|
|
|
'(+evil:align-right . evil-traces-global))
|
|
|
|
(evil-traces-mode))
|
|
|
|
|
|
|
|
|
2019-03-04 20:42:04 -05:00
|
|
|
;; Allows you to use the selection for * and #
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-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
|
|
|
;;
|
2019-07-21 23:31:42 +02:00
|
|
|
;;; Text object plugins
|
2017-06-05 00:47:56 +02:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! exato
|
2019-07-21 23:31:42 +02:00
|
|
|
:commands evil-outer-xml-attr evil-inner-xml-attr)
|
2019-10-26 21:34:44 -04:00
|
|
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
;;; Keybinds
|
|
|
|
|
|
|
|
;; Keybinds that have no Emacs+evil analogues (i.e. don't exist):
|
|
|
|
;; zu{q,w} - undo last marking
|
|
|
|
|
2019-10-30 22:26:00 -04:00
|
|
|
(map! :v "@" #'+evil:apply-macro
|
2020-12-11 01:44:41 -05:00
|
|
|
:m [C-i] #'evil-jump-forward
|
2019-10-26 21:34:44 -04:00
|
|
|
|
2020-08-21 03:01:15 -04:00
|
|
|
;; implement dictionary keybinds
|
|
|
|
;; evil already defines 'z=' to `ispell-word' = correct word at point
|
2020-09-02 13:58:27 -04:00
|
|
|
(:when (featurep! :checkers spell)
|
2020-10-04 16:14:16 -04:00
|
|
|
:n "zg" #'+spell/add-word
|
2020-09-02 13:58:27 -04:00
|
|
|
:n "zw" #'+spell/remove-word
|
|
|
|
:m "[s" #'+spell/previous-error
|
|
|
|
:m "]s" #'+spell/next-error)
|
2020-08-21 03:01:15 -04:00
|
|
|
|
2019-10-26 21:34:44 -04:00
|
|
|
;; ported from vim-unimpaired
|
|
|
|
:n "] SPC" #'+evil/insert-newline-below
|
|
|
|
:n "[ SPC" #'+evil/insert-newline-above
|
|
|
|
:n "]b" #'next-buffer
|
|
|
|
:n "[b" #'previous-buffer
|
|
|
|
:n "]f" #'+evil/next-file
|
|
|
|
:n "[f" #'+evil/previous-file
|
|
|
|
:m "]u" #'+evil:url-encode
|
|
|
|
:m "[u" #'+evil:url-decode
|
|
|
|
:m "]y" #'+evil:c-string-encode
|
|
|
|
:m "[y" #'+evil:c-string-decode
|
|
|
|
(:when (featurep! :lang web)
|
2020-05-04 16:53:26 -04:00
|
|
|
:m "]x" #'+web:encode-html-entities
|
|
|
|
:m "[x" #'+web:decode-html-entities)
|
2019-10-26 21:34:44 -04:00
|
|
|
(:when (featurep! :ui vc-gutter)
|
2020-05-04 16:53:26 -04:00
|
|
|
:m "]d" #'git-gutter:next-hunk
|
|
|
|
:m "[d" #'git-gutter:previous-hunk)
|
2019-10-26 21:34:44 -04:00
|
|
|
(:when (featurep! :ui hl-todo)
|
2020-05-04 16:53:26 -04:00
|
|
|
:m "]t" #'hl-todo-next
|
|
|
|
:m "[t" #'hl-todo-previous)
|
2019-10-26 21:34:44 -04:00
|
|
|
(:when (featurep! :ui workspaces)
|
2020-05-04 16:53:26 -04:00
|
|
|
:n "gt" #'+workspace:switch-next
|
|
|
|
:n "gT" #'+workspace:switch-previous
|
|
|
|
:n "]w" #'+workspace/switch-right
|
|
|
|
:n "[w" #'+workspace/switch-left)
|
2020-02-20 18:21:56 -05:00
|
|
|
(:when (featurep! :ui tabs)
|
2020-05-04 16:53:26 -04:00
|
|
|
:n "gt" #'centaur-tabs-forward
|
|
|
|
:n "gT" #'centaur-tabs-backward)
|
2019-10-26 21:34:44 -04:00
|
|
|
|
|
|
|
;; custom vim-unmpaired-esque keys
|
2019-10-30 22:26:00 -04:00
|
|
|
:m "]#" #'+evil/next-preproc-directive
|
|
|
|
:m "[#" #'+evil/previous-preproc-directive
|
2019-10-26 21:34:44 -04:00
|
|
|
:m "]a" #'evil-forward-arg
|
|
|
|
:m "[a" #'evil-backward-arg
|
2019-10-30 22:21:37 -04:00
|
|
|
:m "]c" #'+evil/next-comment
|
|
|
|
:m "[c" #'+evil/previous-comment
|
2019-10-26 21:34:44 -04:00
|
|
|
:m "]e" #'next-error
|
|
|
|
:m "[e" #'previous-error
|
|
|
|
:n "]F" #'+evil/next-frame
|
|
|
|
:n "[F" #'+evil/previous-frame
|
|
|
|
:m "]h" #'outline-next-visible-heading
|
|
|
|
:m "[h" #'outline-previous-visible-heading
|
2019-10-30 22:26:00 -04:00
|
|
|
:m "]m" #'+evil/next-beginning-of-method
|
|
|
|
:m "[m" #'+evil/previous-beginning-of-method
|
|
|
|
:m "]M" #'+evil/next-end-of-method
|
|
|
|
:m "[M" #'+evil/previous-end-of-method
|
2019-10-26 21:34:44 -04:00
|
|
|
:n "[o" #'+evil/insert-newline-above
|
|
|
|
:n "]o" #'+evil/insert-newline-below
|
|
|
|
:n "gp" #'+evil/reselect-paste
|
2019-12-21 03:59:46 -05:00
|
|
|
:v "gp" #'+evil/alt-paste
|
2019-10-26 21:34:44 -04:00
|
|
|
:nv "g@" #'+evil:apply-macro
|
|
|
|
:nv "gc" #'evilnc-comment-operator
|
|
|
|
:nv "gx" #'evil-exchange
|
|
|
|
:nv "gy" #'+evil:yank-unindented
|
|
|
|
:n "g=" #'evil-numbers/inc-at-pt
|
|
|
|
:n "g-" #'evil-numbers/dec-at-pt
|
|
|
|
:v "g=" #'evil-numbers/inc-at-pt-incremental
|
|
|
|
:v "g-" #'evil-numbers/dec-at-pt-incremental
|
|
|
|
:v "g+" #'evil-numbers/inc-at-pt
|
|
|
|
(:when (featurep! :tools lookup)
|
2020-05-04 16:53:26 -04:00
|
|
|
:nv "K" #'+lookup/documentation
|
|
|
|
:nv "gd" #'+lookup/definition
|
|
|
|
:nv "gD" #'+lookup/references
|
2021-02-26 21:29:52 -05:00
|
|
|
:nv "gf" #'+lookup/file
|
|
|
|
:nv "gI" #'+lookup/implementations
|
|
|
|
:nv "gA" #'+lookup/assignments)
|
2019-10-26 21:34:44 -04:00
|
|
|
(:when (featurep! :tools eval)
|
2020-05-04 16:53:26 -04:00
|
|
|
:nv "gr" #'+eval:region
|
|
|
|
:n "gR" #'+eval/buffer
|
|
|
|
:v "gR" #'+eval:replace-region
|
|
|
|
;; Restore these keybinds, since the blacklisted/overwritten gr/gR will
|
|
|
|
;; undo them:
|
|
|
|
(:after dired
|
|
|
|
:map dired-mode-map
|
|
|
|
:n "gr" #'revert-buffer)
|
|
|
|
(:after notmuch
|
|
|
|
:map notmuch-common-keymap
|
|
|
|
:n "gr" #'notmuch-refresh-this-buffer
|
|
|
|
:n "gR" #'notmuch-poll-and-refresh-this-buffer)
|
|
|
|
(:after elfeed
|
|
|
|
:map elfeed-search-mode-map
|
|
|
|
:n "gr" #'elfeed-search-update--force
|
|
|
|
:n "gR" #'elfeed-search-fetch))
|
2019-10-26 21:34:44 -04:00
|
|
|
|
|
|
|
;; custom evil keybinds
|
2019-11-04 12:49:48 -05:00
|
|
|
:nv "zn" #'+evil:narrow-buffer
|
2019-10-26 21:34:44 -04:00
|
|
|
:n "zN" #'doom/widen-indirectly-narrowed-buffer
|
|
|
|
:n "zx" #'kill-current-buffer
|
2020-08-05 20:55:30 -04:00
|
|
|
:n "ZX" #'doom/save-and-kill-buffer
|
2019-10-26 21:34:44 -04:00
|
|
|
;; don't leave visual mode after shifting
|
2021-01-03 17:18:43 -05:00
|
|
|
:v "<" #'+evil/shift-left ; vnoremap < <gv
|
|
|
|
:v ">" #'+evil/shift-right ; vnoremap > >gv
|
2019-10-26 21:34:44 -04:00
|
|
|
|
|
|
|
;; window management (prefix "C-w")
|
|
|
|
(:map evil-window-map
|
2020-05-04 16:53:26 -04:00
|
|
|
;; Navigation
|
|
|
|
"C-h" #'evil-window-left
|
|
|
|
"C-j" #'evil-window-down
|
|
|
|
"C-k" #'evil-window-up
|
|
|
|
"C-l" #'evil-window-right
|
|
|
|
"C-w" #'other-window
|
2021-03-06 09:59:50 -05:00
|
|
|
;; Extra split commands
|
2021-03-06 10:30:32 -05:00
|
|
|
"S" #'+evil/window-split-and-follow
|
|
|
|
"V" #'+evil/window-vsplit-and-follow
|
2020-05-04 16:53:26 -04:00
|
|
|
;; Swapping windows
|
|
|
|
"H" #'+evil/window-move-left
|
|
|
|
"J" #'+evil/window-move-down
|
|
|
|
"K" #'+evil/window-move-up
|
|
|
|
"L" #'+evil/window-move-right
|
|
|
|
"C-S-w" #'ace-swap-window
|
|
|
|
;; Window undo/redo
|
|
|
|
(:prefix "m"
|
|
|
|
"m" #'doom/window-maximize-buffer
|
|
|
|
"v" #'doom/window-maximize-vertically
|
|
|
|
"s" #'doom/window-maximize-horizontally)
|
|
|
|
"u" #'winner-undo
|
|
|
|
"C-u" #'winner-undo
|
|
|
|
"C-r" #'winner-redo
|
|
|
|
"o" #'doom/window-enlargen
|
|
|
|
;; Delete window
|
|
|
|
"d" #'evil-window-delete
|
2020-09-28 08:23:54 -04:00
|
|
|
"C-C" #'ace-delete-window
|
|
|
|
"T" #'tear-off-window)
|
2019-10-26 21:34:44 -04:00
|
|
|
|
|
|
|
;; text objects
|
|
|
|
:textobj "a" #'evil-inner-arg #'evil-outer-arg
|
|
|
|
:textobj "B" #'evil-textobj-anyblock-inner-block #'evil-textobj-anyblock-a-block
|
|
|
|
:textobj "c" #'evilnc-inner-comment #'evilnc-outer-commenter
|
|
|
|
:textobj "f" #'+evil:defun-txtobj #'+evil:defun-txtobj
|
|
|
|
:textobj "g" #'+evil:whole-buffer-txtobj #'+evil:whole-buffer-txtobj
|
|
|
|
:textobj "i" #'evil-indent-plus-i-indent #'evil-indent-plus-a-indent
|
|
|
|
:textobj "j" #'evil-indent-plus-i-indent-up-down #'evil-indent-plus-a-indent-up-down
|
2019-10-29 18:20:35 -04:00
|
|
|
:textobj "k" #'evil-indent-plus-i-indent-up #'evil-indent-plus-a-indent-up
|
2020-10-27 23:18:06 -04:00
|
|
|
:textobj "q" #'+evil:inner-any-quote #'+evil:outer-any-quote
|
2020-02-04 13:58:43 -05:00
|
|
|
:textobj "u" #'+evil:inner-url-txtobj #'+evil:outer-url-txtobj
|
2019-10-29 18:20:35 -04:00
|
|
|
:textobj "x" #'evil-inner-xml-attr #'evil-outer-xml-attr
|
2019-10-26 21:34:44 -04:00
|
|
|
|
2021-03-27 18:08:56 -04:00
|
|
|
;; evil-easymotion
|
2019-12-27 01:54:01 -05:00
|
|
|
(:after evil-easymotion
|
2020-05-04 16:53:26 -04:00
|
|
|
:m "gs" evilem-map
|
|
|
|
(:map evilem-map
|
|
|
|
"a" (evilem-create #'evil-forward-arg)
|
|
|
|
"A" (evilem-create #'evil-backward-arg)
|
|
|
|
"s" #'evil-avy-goto-char-2
|
2020-07-21 16:18:46 -04:00
|
|
|
"SPC" (cmd! (let ((current-prefix-arg t)) (evil-avy-goto-char-timer)))
|
2020-05-04 16:53:26 -04:00
|
|
|
"/" #'evil-avy-goto-char-timer))
|
|
|
|
|
|
|
|
;; evil-snipe
|
2019-10-26 21:34:44 -04:00
|
|
|
(:after evil-snipe
|
2020-05-04 16:53:26 -04:00
|
|
|
:map evil-snipe-parent-transient-map
|
2020-06-04 20:02:46 -04:00
|
|
|
"C-;" (cmd! (require 'evil-easymotion)
|
|
|
|
(call-interactively
|
|
|
|
(evilem-create #'evil-snipe-repeat
|
|
|
|
:bind ((evil-snipe-scope 'whole-buffer)
|
|
|
|
(evil-snipe-enable-highlight)
|
|
|
|
(evil-snipe-enable-incremental-highlight))))))
|
2019-10-26 21:34:44 -04:00
|
|
|
|
|
|
|
;; evil-surround
|
|
|
|
:v "S" #'evil-surround-region
|
|
|
|
:o "s" #'evil-surround-edit
|
|
|
|
:o "S" #'evil-Surround-edit
|
|
|
|
|
2020-02-25 00:22:26 +02:00
|
|
|
;; evil-lion
|
|
|
|
:n "gl" #'evil-lion-left
|
|
|
|
:n "gL" #'evil-lion-right
|
|
|
|
:v "gl" #'evil-lion-left
|
|
|
|
:v "gL" #'evil-lion-right
|
|
|
|
|
2019-10-26 21:34:44 -04:00
|
|
|
;; Omni-completion
|
|
|
|
(:when (featurep! :completion company)
|
2020-05-04 16:53:26 -04:00
|
|
|
(:prefix "C-x"
|
|
|
|
:i "C-l" #'+company/whole-lines
|
|
|
|
:i "C-k" #'+company/dict-or-keywords
|
|
|
|
:i "C-f" #'company-files
|
|
|
|
:i "C-]" #'company-etags
|
|
|
|
:i "s" #'company-ispell
|
|
|
|
:i "C-s" #'company-yasnippet
|
|
|
|
:i "C-o" #'company-capf
|
|
|
|
:i "C-n" #'+company/dabbrev
|
|
|
|
:i "C-p" #'+company/dabbrev-code-previous)))
|