From d67c1a7cdab60216e163236fb3b528fe09089a58 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Mon, 3 Feb 2020 18:22:21 -0500 Subject: [PATCH] Better org-brain integration for org-cliplink and link-hint --- emacs/init.org | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/emacs/init.org b/emacs/init.org index 15437ce..29d7563 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -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