Commit ea867b757bfb

Vincent Demeester <vincent@sbr.pm>
2026-04-02 11:26:00
TIL capture: prepend new entries (most recent on top)
Uses file+function to jump to first heading, so new TILs are inserted before existing ones.
1 parent 32c0c24
Changed files (1)
dots
config
emacs
dots/config/emacs/init.el
@@ -2132,7 +2132,10 @@ Prompts for URL with clipboard as default.  Suitable for %(sexp) in capture temp
 	       t)
   (add-to-list 'org-capture-templates
 	       `("ii" "💡 Today I Learned" entry
-		 (file ,(expand-file-name "til.org" org-directory))
+		 (file+function ,(expand-file-name "til.org" org-directory)
+				 (lambda () (goto-char (point-min))
+					   (re-search-forward "^\\*" nil t)
+					   (beginning-of-line)))
 		 "* %^{Title}%^g\n\n<%<%Y-%m-%d %a>>\n\n%?\n"
 		 :empty-lines 1)
 	       t)