From 87a9456df1f29417ff1927904754191ecd3fae6f Mon Sep 17 00:00:00 2001 From: Blaise Thompson Date: Sun, 9 Feb 2020 21:29:21 -0600 Subject: 2020-02-09 21:29 --- emacs/init.el | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/emacs/init.el b/emacs/init.el index d45916b..9a50003 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -300,6 +300,26 @@ (add-hook 'after-init-hook 'global-company-mode) (add-hook 'before-save-hook 'delete-trailing-whitespace) + + +;;; journaling ------------------------------------------------------------------------------------ + + +(setq org-journal-dir "~/journal/") + +(defun get-journal-file-today () + "Return filename for today's journal entry." + (let ((daily-name (format-time-string "%Y-%m-%d.org"))) + (expand-file-name (concat org-journal-dir daily-name)))) + + +(defun journal-file-today () + "Create and load a journal file based on today's date." + (interactive) + (copy-file "~/journal/template.org" (get-journal-file-today)) + (find-file (get-journal-file-today))) + + ;;; keybindings ----------------------------------------------------------------------------------- @@ -317,7 +337,7 @@ (evil-leader/set-key "a" 'org-agenda-list) (evil-leader/set-key "c" 'calc) (evil-leader/set-key "f" 'helm-find-files) -(evil-leader/set-key "j" 'dired-jump) +(evil-leader/set-key "j" 'journal-file-today) (evil-leader/set-key "k" 'kill-buffer) (evil-leader/set-key "l" 'helm-bibtex) (evil-leader/set-key "m" 'helm-mini) -- cgit v1.2.3