emacs: improve org note handline

This commit is contained in:
Julian Mutter 2023-06-27 10:30:47 +02:00
parent b6c9946cd9
commit 7c63a2c148

View File

@ -108,28 +108,26 @@
(map! :map org-mode-map :nvi "M-@" #'org-cite-insert) (map! :map org-mode-map :nvi "M-@" #'org-cite-insert)
(map! :map doom-leader-notes-map "r r" #'org-roam-node-find) (map! :map doom-leader-notes-map "r r" #'org-roam-node-find)
(map! :map doom-leader-notes-map "r t" #'org-roam-buffer-toggle) (map! :map doom-leader-notes-map "r t" #'org-roam-buffer-toggle)
(map! :map doom-leader-notes-map "s" #'fd-org-notes-search-follow-symlinks)
(setq org-roam-preview-function #'fd-my-org-roam-preview-function) (after! org
(add-to-list 'org-capture-templates
'("b" "Bachelor todo" entry
(file+headline "bachelor/todo.org" "Inbox")
"* IDEA %?\n%i\n%T\n%a" :prepend t)
))
;; Custom preview function including subheadings
(defun fd-my-org-roam-preview-function ()
"Return the preview content at point.
This function returns the all contents under the current (defun fd-org-notes-search-follow-symlinks (query)
headline, up to the next headline." "Alternative to +default/org-notes-search which follows symbolic links for better project inlusion"
(let ((beg (save-excursion (interactive
(org-roam-end-of-meta-data t) (list (if (doom-region-active-p)
(point))) (buffer-substring-no-properties
(end (save-excursion (doom-region-beginning)
(condition-case nil (doom-region-end))
(progn "")))
(outline-forward-same-level) (require 'org)
(backward-char) (+vertico-file-search :query query :in org-directory :args '("-L")))
(point)
)
(error
(point-max))))))
(string-trim (buffer-substring-no-properties beg end))))
#+end_src #+end_src
** TeX ** TeX