diff --git a/modules/editor/evil/autoload/evil.el b/modules/editor/evil/autoload/evil.el index 326aec771..575f97077 100644 --- a/modules/editor/evil/autoload/evil.el +++ b/modules/editor/evil/autoload/evil.el @@ -93,13 +93,20 @@ the only window, use evil-window-move-* (e.g. `evil-window-move-far-left')." (interactive) (+evil--window-swap 'down)) ;;;###autoload -(defun +evil/easymotion () - "Invoke and lazy-load `evil-easymotion' without compromising which-key -integration." - (interactive) - (require 'evil-easymotion) - (setq prefix-arg current-prefix-arg) - (push '(t . easymotion) unread-command-events)) +(defun +evil/easymotion (&optional state keymap) + "Invoke `evil-easymotion' lazily without compromising which-key integration." + (interactive (list 'motion 'global)) + (let ((prefix (this-command-keys))) + (require 'evil-easymotion) + (evil-define-key* state keymap prefix evilem-map) + (setq prefix-arg current-prefix-arg + unread-command-events + (mapcar (lambda (e) (cons t e)) + (vconcat (when evil-this-operator + (where-is-internal evil-this-operator + nil + t)) + prefix))))) ;;;###autoload (autoload '+evil:apply-macro "editor/evil/autoload/evil" nil t) (evil-define-operator +evil:apply-macro (beg end) diff --git a/modules/editor/evil/config.el b/modules/editor/evil/config.el index d4ce0e3dd..3a77cd7a9 100644 --- a/modules/editor/evil/config.el +++ b/modules/editor/evil/config.el @@ -206,7 +206,6 @@ directives. By default, this only recognizes C directives.") (use-package! evil-easymotion :commands evilem-create evilem-default-keybindings :config - (evilem-default-keybindings "") ;; 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))) @@ -552,9 +551,9 @@ To change these keys see `+evil-repeat-keys'." :textobj "k" #'evil-indent-plus-i-indent-up #'evil-indent-plus-a-indent-up :textobj "x" #'evil-inner-xml-attr #'evil-outer-xml-attr - ;; evil-easymotion + ;; evil-easymotion (see `+evil/easymotion') (:after evil-easymotion - (:prefix "" ; see `+evil/easymotion' + (:map evilem-map "a" (evilem-create #'evil-forward-arg) "A" (evilem-create #'evil-backward-arg) "s" #'evil-avy-goto-char-2