diff --git a/modules/lang/org/autoload/org-link.el b/modules/lang/org/autoload/org-link.el index ff29cac19..3ab615248 100644 --- a/modules/lang/org/autoload/org-link.el +++ b/modules/lang/org/autoload/org-link.el @@ -411,6 +411,15 @@ exist, and `org-link' otherwise." (delete-region (match-beginning 0) (match-end 0)) (insert label)))) +;;;###autoload +(defun +org/yank-link () + "Copy the url at point to the clipboard. +If on top of an Org link, will only copy the link component." + (interactive) + (let ((url (thing-at-point 'url))) + (kill-new (or url (user-error "No URL at point"))) + (message "Copied link: %s" url))) + ;;;###autoload (defun +org/play-gif-at-point () "TODO" diff --git a/modules/lang/org/config.el b/modules/lang/org/config.el index 8e2fe5550..f3c096a98 100644 --- a/modules/lang/org/config.el +++ b/modules/lang/org/config.el @@ -988,6 +988,7 @@ between the two." "s" #'org-store-link "S" #'org-insert-last-stored-link "t" #'org-toggle-link-display + "y" #'+org/yank-link (:when (modulep! :os macos) "g" #'org-mac-link-get-link)) (:prefix ("P" . "publish")