diff options
Diffstat (limited to 'emacs')
-rw-r--r-- | emacs/init.el | 22 |
1 files changed, 21 insertions, 1 deletions
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) |