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,7 +113,47 @@
;; org-gcal-client-secret "6AQ7_vtvqLTeL-ltDcwrIvao"
;; org-gcal-file-alist '(("tim.vandeurzen@gmail.com" . "~/org/agendas/google.org")))
(use-package! org-super-agenda
(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
......@@ -175,9 +193,9 @@
))))))
))
(org-super-agenda-mode))
)
(org-roam-autosync-mode)
;; Here are some additional functions/macros that could help you configure Doom:
......
......@@ -14,7 +14,7 @@
;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its
;; directory (for easy access to its source code).
(doom! :input
(doom! :input ;
;;chinese
;;japanese
;;layout ; auie,ctsrnm is the superior home row
......@@ -52,7 +52,7 @@
;;zen ; distraction-free coding or writing
:editor
(evil +everywhere); come to the dark side, we have cookies
(evil +everywhere) ; come to the dark side, we have cookies
file-templates ; auto-snippets for empty files
fold ; (nigh) universal code folding
;;(format +onsave) ; automated prettiness
......@@ -147,7 +147,11 @@
;;nim ; python + lisp at the speed of c
;;nix ; I hereby declare "nix geht mehr!"
;;ocaml ; an objective camel
(org +roam2 +noter +pandoc +pretty) ; organize your plain life in plain text
(org
+roam2
+noter
+pandoc
+pretty) ; organize your plain life in plain text
;;php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional
......@@ -158,7 +162,8 @@
;;rest ; Emacs as a REST client
;;rst ; ReST in peace
;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"}
rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
(rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
+lsp)
;;scala ; java, but good
;;(scheme +guile) ; a fully conniving family of lisps
sh ; she sells {ba,z,fi}sh shells on the C xor
......
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