summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBlaise Thompson <blaise@untzag.com>2020-02-09 21:29:21 -0600
committerBlaise Thompson <blaise@untzag.com>2020-02-09 21:29:21 -0600
commit87a9456df1f29417ff1927904754191ecd3fae6f (patch)
treee656d7faa673f0897a3a6263532aa06a4f89753a
parent17a160c50d1a3e712811e5602c395c68f18e4eb6 (diff)
2020-02-09 21:29
-rw-r--r--emacs/init.el22
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)