mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-03 12:27:26 -05:00
org/org: new command +org/remove-link, bound to C-c C-S-l
This commit is contained in:
@ -282,3 +282,18 @@ with `org-cycle'). Also:
|
|||||||
(let ((window-beg (window-start)))
|
(let ((window-beg (window-start)))
|
||||||
(org-cycle)
|
(org-cycle)
|
||||||
(set-window-start nil window-beg))))))
|
(set-window-start nil window-beg))))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +org/remove-link ()
|
||||||
|
"Unlink the text at point."
|
||||||
|
(interactive)
|
||||||
|
(unless (org-in-regexp org-bracket-link-regexp 1)
|
||||||
|
(user-error "No link at point"))
|
||||||
|
(save-excursion
|
||||||
|
(let ((remove (list (match-beginning 0) (match-end 0)))
|
||||||
|
(description (if (match-end 3)
|
||||||
|
(org-match-string-no-properties 3)
|
||||||
|
(org-match-string-no-properties 1))))
|
||||||
|
(apply #'delete-region remove)
|
||||||
|
(insert description))))
|
||||||
|
|
||||||
|
@ -148,6 +148,7 @@
|
|||||||
between the two."
|
between the two."
|
||||||
(map! (:map org-mode-map
|
(map! (:map org-mode-map
|
||||||
"RET" #'org-return-indent
|
"RET" #'org-return-indent
|
||||||
|
"C-c C-S-l" #'+org/remove-link
|
||||||
:n "j" "gj"
|
:n "j" "gj"
|
||||||
:n "k" "gk")
|
:n "k" "gk")
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user