I use the following snippet to quickly link to headings by ID with
via org-insert-link. If there's any interest, I'm happy to clean this
up and submit a patch but I figured I'd ask first.

    (org-link-set-parameters
    "id"
    :complete
    (lambda (&optional _prefix)
    (unless org-id-locations (org-id-locations-load))
    (when-let* ((id (org-id-get-with-outline-path-completion
                        '((org-id-files . (:maxlevel . 10))))))
        (concat "id:" id)))
    :insert-description
    (lambda (link desc)
    (or (org-string-nw-p desc)
        (when-let* ((loc (org-id-find (string-remove-prefix "id:" link))))
            (org-with-file-buffer (car loc)
            (save-excursion
                (goto-char (cdr loc))
                (org-link-display-format
                (org-get-heading t t t t))))))))

Reply via email to