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 @@ ...@@ -76,32 +76,10 @@
org-id-track-globally t) org-id-track-globally t)
(setq org-roam-directory "~/org/roam/" (setq org-roam-directory "~/org/roam/"
org-roam-v2-ack t) 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 (setq org-roam-capture-templates
'(("d" "default" plain '(("d" "default" plain
"%?" "%?"
...@@ -135,49 +113,89 @@ ...@@ -135,49 +113,89 @@
;; org-gcal-client-secret "6AQ7_vtvqLTeL-ltDcwrIvao" ;; org-gcal-client-secret "6AQ7_vtvqLTeL-ltDcwrIvao"
;; org-gcal-file-alist '(("tim.vandeurzen@gmail.com" . "~/org/agendas/google.org"))) ;; org-gcal-file-alist '(("tim.vandeurzen@gmail.com" . "~/org/agendas/google.org")))
(use-package! org-super-agenda (org-roam-db-autosync-mode))
:after org-agenda
:config ;(defun vulpea-agenda-files-update (&rest _)
(setq org-agenda-custom-commands ; "Update the value of `org-agenda-files'."
'(("z" "Custom Day" ; (setq org-agenda-files (vulpea-project-files)))
((agenda "" ((org-agenda-span 'day) ;
(org-super-agenda-groups ;(advice-add 'org-agenda :before #'vulpea-agenda-files-update)
'((:log t)
(:name "Schedule" (add-hook! org-mode :append
:time-grid t) #'visual-line-mode
(:habit t) #'org-appear-mode)
(:name "Scheduled future"
:scheduled future) (defun tim/org-roam-filter-by-tag (tag)
(:name "Scheduled past" (lambda (node)
:scheduled past) (member tag (org-roam-node-tags node))))
(:name "Due today"
:deadline today) (defun ayrat555/org-roam-directories ()
(:name "Overdue" (let ((files (directory-files org-roam-directory)))
:deadline past) (seq-filter (lambda (name)
(:name "Due soon" (and (file-directory-p (concat org-roam-directory name))
:deadline future) (not (string-prefix-p "." name))))
(:name "Waiting" files)))
:todo "WAITING"
:order 10)
)))))) (defun tim/org-roam-find-project-workspace ()
("w" "Custom Week" (interactive)
((agenda "" ((org-agenda-span 'week)
(org-super-agenda-groups (let* ((directory (completing-read "org-roam directory: " (ayrat555/org-roam-directories)))
'((:log t) (org-roam-directory (expand-file-name directory org-roam-directory)))
(:name "Schedule" (org-roam-node-find
:time-grid t) nil
(:name "Planning" nil
:scheduled t) (tim/org-roam-filter-by-tag directory))
(:name "Due" ))
:deadline t)
(:name "Overdue" (map! :leader
:deadline past) (:prefix-map ("n" . "notes")
)))))) (:prefix ("w" . "workspace")
)) :desc "New project in a workspace" "n" #'tim/org-roam-find-project-workspace)))
(org-super-agenda-mode))
) (use-package! org-super-agenda
:after org-agenda
(org-roam-autosync-mode) :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: ;; 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