summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.el10
-rw-r--r--lisp/org-custom.el20
2 files changed, 27 insertions, 3 deletions
diff --git a/init.el b/init.el
index 31ef9dd..d364a92 100644
--- a/init.el
+++ b/init.el
@@ -74,7 +74,15 @@
"3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa"
"a27c00821ccfd5a78b01e4f35dc056706dd9ede09a8b90c6955ae6a390eb1c1e"
default))
- '(package-selected-packages nil)
+ '(package-selected-packages
+ '(all-the-icons clang-format cmake-mode company-quickhelp css-eldoc
+ dart-mode dracula-theme drag-stuff flycheck
+ git-gutter-fringe go-mode hl-todo ledger-mode magit
+ marginalia markdown-mode mood-line nu-mode
+ nushell-mode orderless org-download org-modern
+ org-roam perfect-margin plantuml-mode projectile
+ pyvenv rg rust-mode vertico web-mode yaml-mode
+ yasnippet-snippets))
'(package-vc-selected-packages '((aider :url "https://github.com/tninja/aider.el")))
'(safe-local-variable-values
'((eval setq-local org-log-done 'time) (js-indent-level . 4)))
diff --git a/lisp/org-custom.el b/lisp/org-custom.el
index d927a7c..d999a83 100644
--- a/lisp/org-custom.el
+++ b/lisp/org-custom.el
@@ -87,6 +87,22 @@
;; alert-default-style 'libnotify)
;; (org-alert-enable))
+(defun my/org-roam-dailies-previous-file ()
+ "Return filename of the most recent existing org-roam daily before today."
+ (let* ((dir (file-name-as-directory org-roam-directory))
+ (time (current-time))
+ (found nil)
+ (i 1))
+ (while (and (not found) (< i 366))
+ (let* ((date (format-time-string "%Y-%m-%d"
+ (time-subtract time (days-to-time i))))
+ (file (expand-file-name (concat date ".org") dir)))
+ (when (file-exists-p file)
+ (setq found file)))
+ (setq i (1+ i)))
+ found))
+
+
(use-package org-roam
:ensure t
:custom
@@ -106,7 +122,7 @@
'(("d" "default" entry
"* %?"
:target (file+head "%<%Y-%m-%d>.org"
- "#+title: %<%Y-%m-%d> 📰 \n#+filetags: :dailies: \n\n[[file:%(format-time-string \"%Y-%m-%d\" (time-subtract (current-time) (days-to-time 1))).org][← Previous Day]]\n\n* Tasks 🎯\n\n* Notes 📁\n\n"))))
+ "#+title: %<%Y-%m-%d> 📰 \n#+filetags: :dailies: \n\n[[file:%(my/org-roam-dailies-previous-file)][← Previous Day]]\n\n* Tasks 🎯\n\n"))))
(setq org-roam-capture-templates
'(("d" "default" plain
"%?"
@@ -117,7 +133,7 @@
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title} 🎫\n #+filetags: :issues:ticket:project:canonical\n")
:unnarrowed t)
("b" "book" plain
- "\n\n* Overview \n "
+ "\n\n* Overview \n\n* Rating \n\n* Links \n "
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title} 📚\n #+filetags: :books\n")
:unnarrowed t)))
(org-roam-setup)