diff options
author | noa | 2024-10-06 13:28:54 +0800 |
---|---|---|
committer | noa | 2024-10-06 13:28:54 +0800 |
commit | 6fe3e83f8e776d3c7ae427ccd299ec51ea74b8f0 (patch) | |
tree | a4548530f07a21c21cf12ae5e71cbfb9393d43e1 | |
parent | 1b6ba459142657cb4a3f8c7f1764055a85f7e5f2 (diff) |
Add command to open today's diary entry
-rw-r--r-- | emacs/init.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/emacs/init.el b/emacs/init.el index 116172f..927a73d 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -735,6 +735,14 @@ The misspelled word is taken from OVERLAY. WORD is the corrected word." ("<f12>" . howm-list-all) ("<C-f12>" . howm-create)) (setopt howm-file-name-format "%Y-%m-%dT%H%M%S.md") + +(defun noa/open-todays-diary () + (interactive) + (let ((date (format-time-string "%Y-%m-%d"))) + (find-file (format "~/Documents/notes/diary/%s.md" date)) + (if (= (buffer-size) 0) + (insert (concat "# " date "\n\n"))))) + ;;; Bibliography management (use-package ebib :ensure t |