diff --git a/modules/feature/evil/autoload/evil.el b/modules/feature/evil/autoload/evil.el index 51ba28006..42fda391a 100644 --- a/modules/feature/evil/autoload/evil.el +++ b/modules/feature/evil/autoload/evil.el @@ -18,36 +18,6 @@ `(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 "" - :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 ;; diff --git a/modules/feature/evil/config.el b/modules/feature/evil/config.el index 52a854dcd..509e58b9b 100644 --- a/modules/feature/evil/config.el +++ b/modules/feature/evil/config.el @@ -144,7 +144,31 @@ variable for an explanation of the defaults (in comments). See ;; Ensure jump points are created (defun +evil*set-jump (&rest _) (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 "" + :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)) ;;