mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-11 13:07:28 -05:00
feat(org): bind <localleader> l y to +org/yank-link
For copying the URL component of an org link at point.
This commit is contained in:
@ -411,6 +411,15 @@ exist, and `org-link' otherwise."
|
|||||||
(delete-region (match-beginning 0) (match-end 0))
|
(delete-region (match-beginning 0) (match-end 0))
|
||||||
(insert label))))
|
(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
|
;;;###autoload
|
||||||
(defun +org/play-gif-at-point ()
|
(defun +org/play-gif-at-point ()
|
||||||
"TODO"
|
"TODO"
|
||||||
|
@ -988,6 +988,7 @@ between the two."
|
|||||||
"s" #'org-store-link
|
"s" #'org-store-link
|
||||||
"S" #'org-insert-last-stored-link
|
"S" #'org-insert-last-stored-link
|
||||||
"t" #'org-toggle-link-display
|
"t" #'org-toggle-link-display
|
||||||
|
"y" #'+org/yank-link
|
||||||
(:when (modulep! :os macos)
|
(:when (modulep! :os macos)
|
||||||
"g" #'org-mac-link-get-link))
|
"g" #'org-mac-link-get-link))
|
||||||
(:prefix ("P" . "publish")
|
(:prefix ("P" . "publish")
|
||||||
|
Reference in New Issue
Block a user