Commit 0b650016 authored by Tim van Deurzen's avatar Tim van Deurzen

Updated with some experimental functions for filtering roam nodes.

parent da839e06
......@@ -76,32 +76,10 @@
org-id-track-globally t)
(setq org-roam-directory "~/org/roam/"
org-roam-v2-ack t)
(cl-defmethod org-roam-node-filetitle ((node org-roam-node))
"Return the file TITLE for the node."
(org-roam-get-keyword "TITLE" (org-roam-node-file node)))
(cl-defmethod org-roam-node-hierarchy ((node org-roam-node))
"Return the hierarchy for the node."
(let ((title (org-roam-node-title node))
(olp (org-roam-node-olp node))
(level (org-roam-node-level node))
(filetitle (org-roam-node-filetitle node)))
(concat
(if (> level 0) (concat filetitle " → "))
(if (> level 1) (concat (string-join olp " → ") " → "))
title))
)
(cl-defmethod org-roam-node-directories ((node org-roam-node))
(if-let ((dirs (file-name-directory (file-relative-name (org-roam-node-file node) org-roam-directory))))
(format "(%s)" (string-join (f-split dirs) "/"))
""))
(setq org-roam-node-display-template "${directories:10} ${hierarchy:40} ${tags:20}")
(setq org-roam-capture-templates
'(("d" "default" plain
"%?"
......@@ -135,49 +113,89 @@
;; org-gcal-client-secret "6AQ7_vtvqLTeL-ltDcwrIvao"
;; org-gcal-file-alist '(("tim.vandeurzen@gmail.com" . "~/org/agendas/google.org")))
(use-package! org-super-agenda
:after org-agenda
:config
(setq org-agenda-custom-commands
'(("z" "Custom Day"
((agenda "" ((org-agenda-span 'day)
(org-super-agenda-groups
'((:log t)
(:name "Schedule"
:time-grid t)
(:habit t)
(:name "Scheduled future"
:scheduled future)
(:name "Scheduled past"
:scheduled past)
(:name "Due today"
:deadline today)
(:name "Overdue"
:deadline past)
(:name "Due soon"
:deadline future)
(:name "Waiting"
:todo "WAITING"
:order 10)
))))))
("w" "Custom Week"
((agenda "" ((org-agenda-span 'week)
(org-super-agenda-groups
'((:log t)
(:name "Schedule"
:time-grid t)
(:name "Planning"
:scheduled t)
(:name "Due"
:deadline t)
(:name "Overdue"
:deadline past)
))))))
))
(org-super-agenda-mode))
)
(org-roam-autosync-mode)
(org-roam-db-autosync-mode))
;(defun vulpea-agenda-files-update (&rest _)
; "Update the value of `org-agenda-files'."
; (setq org-agenda-files (vulpea-project-files)))
;
;(advice-add 'org-agenda :before #'vulpea-agenda-files-update)
(add-hook! org-mode :append
#'visual-line-mode
#'org-appear-mode)
(defun tim/org-roam-filter-by-tag (tag)
(lambda (node)
(member tag (org-roam-node-tags node))))
(defun ayrat555/org-roam-directories ()
(let ((files (directory-files org-roam-directory)))
(seq-filter (lambda (name)
(and (file-directory-p (concat org-roam-directory name))
(not (string-prefix-p "." name))))
files)))
(defun tim/org-roam-find-project-workspace ()
(interactive)
(let* ((directory (completing-read "org-roam directory: " (ayrat555/org-roam-directories)))
(org-roam-directory (expand-file-name directory org-roam-directory)))
(org-roam-node-find
nil
nil
(tim/org-roam-filter-by-tag directory))
))
(map! :leader
(:prefix-map ("n" . "notes")
(:prefix ("w" . "workspace")
:desc "New project in a workspace" "n" #'tim/org-roam-find-project-workspace)))
(use-package! org-super-agenda
:after org-agenda
:config
(setq org-agenda-custom-commands
'(("z" "Custom Day"
((agenda "" ((org-agenda-span 'day)
(org-super-agenda-groups
'((:log t)
(:name "Schedule"
:time-grid t)
(:habit t)
(:name "Scheduled future"
:scheduled future)
(:name "Scheduled past"
:scheduled past)
(:name "Due today"
:deadline today)
(:name "Overdue"
:deadline past)
(:name "Due soon"
:deadline future)
(:name "Waiting"
:todo "WAITING"
:order 10)
))))))
("w" "Custom Week"
((agenda "" ((org-agenda-span 'week)
(org-super-agenda-groups
'((:log t)
(:name "Schedule"
:time-grid t)
(:name "Planning"
:scheduled t)
(:name "Due"
:deadline t)
(:name "Overdue"
:deadline past)
))))))
))
(org-super-agenda-mode))
;; Here are some additional functions/macros that could help you configure Doom:
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment