Fix gs in org-mode #2218

Also makes +evil/easymotion generic; it can now be moved to any key, and
new keys can be added to the <easymotion> event, rather than having to
wait for evilem-map to become available.

Also fixes +org/goto-visible if used before avy is loaded.

Relevant to #1672
This commit is contained in:
Henrik Lissner 2019-12-20 13:40:06 -05:00
parent bff04ed35c
commit 27cabea6b6
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 6 additions and 12 deletions

View file

@ -87,7 +87,8 @@
:m "gs" #'+evil/easymotion ; lazy-load `evil-easymotion'
(:after org
:map org-mode-map
:m "gsh" #'+org/goto-visible)
:prefix "<easymotion>"
"h" #'+org/goto-visible)
(:when (featurep! :editor multiple-cursors)
:prefix "gz"

View file

@ -88,17 +88,9 @@ the only window, use evil-window-move-* (e.g. `evil-window-move-far-left')."
"Invoke and lazy-load `evil-easymotion' without compromising which-key
integration."
(interactive)
(let ((prefix (this-command-keys)))
(evil-define-key* 'motion 'global prefix nil)
(evilem-default-keybindings (key-description prefix))
(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
evil-normal-state-map
t))
prefix)))))
(evilem-default-keybindings "<easymotion>")
(setq prefix-arg current-prefix-arg)
(push '(t . easymotion) unread-command-events))
;;;###autoload (autoload '+evil:apply-macro "editor/evil/autoload/evil" nil t)
(evil-define-operator +evil:apply-macro (beg end)

View file

@ -3,6 +3,7 @@
;;;###autoload
(defun +org-headline-avy ()
"TODO"
(require 'avy)
(save-excursion
(when-let* ((org-reverse-note-order t)
(pos (avy-with avy-goto-line (avy-jump (rx bol (1+ "*") (1+ blank))))))