Browse Source

Introduce hydra for managing links between Org mode items

It's easier to use and easier to keep track of what is available.  It also saves
key precious bindings!
master
Daniel 1 month ago
parent
commit
78b202aed7
No known key found for this signature in database
2 changed files with 13 additions and 3 deletions
  1. 3
    3
      init.el
  2. 10
    0
      site-lisp/db-org.el

+ 3
- 3
init.el View File

@@ -175,14 +175,13 @@
175 175
   (bind-key "<XF86Back>" #'winner-undo)
176 176
   (bind-key "<XF86Forward>" #'winner-redo)
177 177
   (bind-key "<f10>" #'magit-status)
178
-  (bind-key "<f11>" #'db/org-find-links-to-current-item)
179 178
   (bind-key "<f1>" #'db/run-or-hide-eshell)
180 179
   (bind-key "<f2>" #'hydra-feature-shortcuts/body)
181 180
   (bind-key "<f5>" (if (executable-find "ag") #'counsel-ag #'rgrep))
182 181
   (bind-key "<f6>" #'hydra-zoom/body)
183 182
   (bind-key "<f7>" #'dictcc)
184 183
   (bind-key "<f8>" #'bm-toggle)
185
-  (bind-key "<f9>" #'db/org-add-link-to-other-item)
184
+  (bind-key "<f9>" #'hydra-org-linking/body)
186 185
   (bind-key "<C-f8>" #'bm-next)
187 186
   (bind-key "<C-S-f8>" #'bm-previous)
188 187
   (bind-key "C-," #'mc/skip-to-previous-like-this)
@@ -732,7 +731,8 @@
732 731
              db/org-copy-template-for-periodic-task
733 732
              db/org-find-links-to-current-item
734 733
              db/org-add-link-to-other-item
735
-             db/org-add-link-to-current-clock))
734
+             db/org-add-link-to-current-clock
735
+             hydra-org-linking/body))
736 736
 
737 737
 (use-package org
738 738
   :pin "gnu"

+ 10
- 0
site-lisp/db-org.el View File

@@ -733,6 +733,16 @@ in an Org Mode buffer or when the clock is not active."
733 733
   (pcase-let ((`(,location ,description) (cl-first org-stored-links)))
734 734
     (org-insert-link nil location description)))
735 735
 
736
+(defhydra hydra-org-linking (:color blue :hint none)
737
+  "\nLinking between Org mode items.
738
+ _c_urrent clock              _o_ther item (current buffer or default Org file)
739
+ _b_acklinks to current item  _O_ther item (all text files)
740
+"
741
+  ("c" (db/org-add-link-to-current-clock))
742
+  ("o" (db/org-add-link-to-other-item nil))
743
+  ("O" (db/org-add-link-to-other-item t))
744
+  ("b" db/org-find-links-to-current-item))
745
+
736 746
 
737 747
 ;;; End
738 748
 

Loading…
Cancel
Save