Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
org-avy-refile-as-child: Refile Org heading as child of heading selected with Avy
(defun ap/org-avy-refile-as-child ()
"Refile current heading as first child of heading selected with `avy.'"
;; Inspired by `org-teleport':
(let* ((org-reverse-note-order t)
(pos (save-excursion
(avy-with avy-goto-line (avy--generic-jump (rx bol "*") nil avy-style))
(filename (buffer-file-name (or (buffer-base-buffer (current-buffer))
(rfloc (list nil filename nil pos)))
(org-refile nil nil rfloc)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment