Better org-brain integration for org-cliplink and link-hint

This commit is contained in:
Jeremy Dormitzer 2020-02-03 18:22:21 -05:00
parent 57eece61a6
commit d67c1a7cda

View File

@ -1784,13 +1784,29 @@ A very helpful package that provides jump-to-link functionality:
:init
(jdormit/define-prefix "ol" "link-hint")
(leader-def-key "oll" #'link-hint-open-link)
(leader-def-key "olc" #'link-hint-copy-link))
(leader-def-key "olc" #'link-hint-copy-link)
(with-eval-after-load 'org-brain
(general-def org-brain-visualize-mode-map "C-l" #'link-hint-open-link)))
#+END_SRC
* org-cliplink
Intelligently inserts an org-mode link from the clipboard.
#+BEGIN_SRC emacs-lisp
(use-package org-cliplink
:commands (org-cliplink
org-cliplink-clipboard-content)
:init
(with-eval-after-load 'org-brain
(defun org-brain-cliplink-resource ()
"Add a URL from the clipboard as an org-brain resource.
Suggest the URL title as a description for resource."
(interactive)
(let ((url (org-cliplink-clipboard-content)))
(org-brain-add-resource
url
(org-cliplink-retrieve-title-synchronously url)
t)))
(general-def org-brain-visualize-mode-map "L" #'org-brain-cliplink-resource))
:general
(org-mode-map "C-c C-S-l" #'org-cliplink))
#+END_SRC