[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:
parent
183f4ebac0
commit
a4b0d83dc0
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue