[org] Add bascht/wzzk compat layer to no longer rely on Obsidian

Up until now, I was editing the Zettelkasten mostly with Obsidian –
which was looking neat but but ended up being a pain in the butt if you
wanted to use any kind of advanced Vim shortcut. So - let's just emulate
the core functionality with (bascht/wzzk-find-today) with does
essentially the same job as jumping to a non-existing markdown file in Obsidian
This commit is contained in:
Sebastian Schulze 2022-02-15 22:32:07 +01:00
parent 183f4ebac0
commit a4b0d83dc0
No known key found for this signature in database
GPG Key ID: F6BA63C6A7D3044E
1 changed files with 24 additions and 0 deletions

View File

@ -283,6 +283,30 @@
(counsel-org-goto)
(org-reveal)
(org-show-subtree))
(defun bascht/wzzk-find ()
(interactive)
(projectile-find-file-in-directory bascht/wzzk))
(defun bascht/wzzk-find-today ()
(interactive)
(let ((journal-today (expand-file-name (format-time-string "journals/%Y-%m-%d.md") bascht/wzzk)))
(print journal-today)
(unless (file-exists-p journal-today)
(message (concat "No journal for today, creating " (concat journal-today "on the fly.")))
(copy-file (expand-file-name "journals/_template.md" bascht/wzzk) journal-today))
(find-file journal-today))
(beginning-of-buffer)
(replace-string "<% tp.file.creation_date() %>" (format-time-string "%Y-%m-%d %H:%m"))
(replace-string "DailyNote <% tp.file.title.split('-')[0] %>" (format-time-string "DailyNote %Y"))
(end-of-buffer))
(defun bascht/wzzk-find-yesterday ()
(interactive)
(find-file (expand-file-name
(format-time-string "%Y-%m-%d.md"
(time-subtract (current-time) (days-to-time 1))) "~/WirZwei/Zettelkasten/journals")))
(setq org-agenda-category-icon-alist
'(("Todo" "~/.icons/emacs/todo-16x16.png" nil nil :ascent center)
("Personal" "~/.icons/emacs/person-16x16.png" nil nil :ascent center)