Move custom evil arg types back to config.el
No need to autoload that.
This commit is contained in:
parent
46062db978
commit
5a427b1c2b
2 changed files with 25 additions and 31 deletions
|
@ -18,36 +18,6 @@
|
||||||
`(set-evil-initial-state! ,modes ,state))
|
`(set-evil-initial-state! ,modes ,state))
|
||||||
|
|
||||||
|
|
||||||
;;
|
|
||||||
;; Custom arguments / interactive codes
|
|
||||||
;;
|
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(after! evil
|
|
||||||
;; 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)))
|
|
||||||
(macroexpand '
|
|
||||||
(evil-define-interactive-code "<//g>"
|
|
||||||
:ex-arg global-match (list (if (evil-ex-p) evil-ex-argument))))
|
|
||||||
|
|
||||||
;; 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
|
|
||||||
'+evil:align :move-point t :ex-arg 'buffer-match :ex-bang t :evil-mc t :keep-visual t :suppress-operator t)
|
|
||||||
(evil-set-command-properties
|
|
||||||
'+evil:mc :move-point nil :ex-arg 'global-match :ex-bang t :evil-mc t))
|
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Commands
|
;; Commands
|
||||||
;;
|
;;
|
||||||
|
|
|
@ -144,7 +144,31 @@ variable for an explanation of the defaults (in comments). See
|
||||||
;; Ensure jump points are created
|
;; Ensure jump points are created
|
||||||
(defun +evil*set-jump (&rest _)
|
(defun +evil*set-jump (&rest _)
|
||||||
(evil-set-jump))
|
(evil-set-jump))
|
||||||
(advice-add #'counsel-git-grep-action :before #'+evil*set-jump))
|
(advice-add #'counsel-git-grep-action :before #'+evil*set-jump)
|
||||||
|
|
||||||
|
;; --- 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)))
|
||||||
|
(macroexpand '
|
||||||
|
(evil-define-interactive-code "<//g>"
|
||||||
|
:ex-arg global-match (list (if (evil-ex-p) evil-ex-argument))))
|
||||||
|
|
||||||
|
;; 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
|
||||||
|
'+evil:align :move-point t :ex-arg 'buffer-match :ex-bang t :evil-mc t :keep-visual t :suppress-operator t)
|
||||||
|
(evil-set-command-properties
|
||||||
|
'+evil:mc :move-point nil :ex-arg 'global-match :ex-bang t :evil-mc t))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue