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:
parent
ba467fea57
commit
250f3a3899
2 changed files with 10 additions and 0 deletions
|
@ -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"
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue