Set up org-journal

This commit is contained in:
Jeremy Dormitzer 2020-02-19 09:34:21 -05:00
parent 17e0823e6b
commit 2a6a877239

View File

@ -1480,9 +1480,6 @@ A function to add ids to every heading in an Org file:
("n" "Note" entry ("n" "Note" entry
(file ,(agenda-files "notes.org")) (file ,(agenda-files "notes.org"))
"* %^{Description}\n%i%?") "* %^{Description}\n%i%?")
("j" "Journal entry" entry
(file ,(agenda-files "journal.org"))
"* %<%Y-%m-%d %H:%M:%S>%?")
("B" "Brain" plain (function org-brain-goto-end) ("B" "Brain" plain (function org-brain-goto-end)
"* %i%?" :empty-lines 1) "* %i%?" :empty-lines 1)
("l" "Log" entry ("l" "Log" entry
@ -2049,63 +2046,80 @@ Quickly find stuff in Org files:
("C-c n" org-roam-map)) ("C-c n" org-roam-map))
#+END_SRC #+END_SRC
* org-journal
[[https://github.com/bastibe/org-journal][org-journal]] is a package that provides some convenience functions
around keeping a daily Org-mode journal. I also set it up so it plays
nice with Org-roam:
#+BEGIN_SRC emacs-lisp
(use-package org-journal
:defer t
:init
(defun org-journal-file-header-func ()
(let ()
(format "#+TITLE: %s"
(format-time-string "%Y-%m-%d"))))
(defun org-journal-today ()
(interactive)
(org-journal-new-entry t))
(defun org-journal-capture-func ()
(org-journal-new-entry t)
(goto-char (point-min))
;; Account for the #+TITLE
(forward-line))
(add-to-list 'org-capture-templates
'("j" "Journal entry" entry (function org-journal-capture-func)
"* %(format-time-string org-journal-time-format)\n%?"))
(jdormit/define-prefix "oj" "org-journal")
(leader-def-key "ojn" #'org-journal-new-entry)
(leader-def-key "ojt" #'org-journal-today)
:custom
(org-journal-file-type 'daily)
(org-journal-dir (concat (get-dropbox-directory) "/org"))
(org-journal-file-format "%Y-%m-%d.org")
(org-journal-file-header 'org-journal-file-header-func)
(org-journal-carryover-items "")
:general
(org-roam-map "t" 'org-journal-today))
#+END_SRC
* Projectile * Projectile
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package projectile (use-package projectile :commands (projectile-find-file
:commands (projectile-find-file projectile-grep projectile-switch-project projectile-project-root)
projectile-grep :init (defhydra hydra-projectile (:color teal :hint nil) "
projectile-switch-project PROJECTILE: %(projectile-project-root)
projectile-project-root)
:init
(defhydra hydra-projectile (:color teal
:hint nil)
"
PROJECTILE: %(projectile-project-root)
Find File Search/Tags Buffers Cache Find File Search/Tags Buffers Cache
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
_s-f_: file _a_: ag _i_: Ibuffer _c_: cache clear _s-f_: file _a_: ag _i_: Ibuffer _c_: cache clear _ff_: file dwim
_ff_: file dwim _g_: update gtags _b_: switch to buffer _x_: remove known project _g_: update gtags _b_: switch to buffer _x_: remove known project
_fd_: file curr dir _o_: multi-occur _s-k_: Kill all buffers _X_: cleanup non-existing _fd_: file curr dir _o_: multi-occur _s-k_: Kill all buffers _X_:
_r_: recent file ^^^^_z_: cache current cleanup non-existing _r_: recent file ^^^^_z_: cache current _d_:
_d_: dir dir
" " ("a" projectile-ag) ("b" projectile-switch-to-buffer) ("c"
("a" projectile-ag) projectile-invalidate-cache) ("d" projectile-find-dir) ("s-f"
("b" projectile-switch-to-buffer) projectile-find-file) ("ff" projectile-find-file-dwim) ("fd"
("c" projectile-invalidate-cache) projectile-find-file-in-directory) ("g" ggtags-update-tags)
("d" projectile-find-dir) ("s-g" ggtags-update-tags) ("i" projectile-ibuffer) ("K"
("s-f" projectile-find-file) projectile-kill-buffers) ("s-k" projectile-kill-buffers) ("m"
("ff" projectile-find-file-dwim) projectile-multi-occur) ("o" projectile-multi-occur) ("s-p"
("fd" projectile-find-file-in-directory) projectile-switch-project "switch project") ("p"
("g" ggtags-update-tags) projectile-switch-project) ("s" projectile-switch-project) ("r"
("s-g" ggtags-update-tags) projectile-recentf) ("x" projectile-remove-known-project) ("X"
("i" projectile-ibuffer) projectile-cleanup-known-projects) ("z"
("K" projectile-kill-buffers) projectile-cache-current-file) ("`"
("s-k" projectile-kill-buffers) hydra-projectile-other-window/body "other window") ("q" nil
("m" projectile-multi-occur) "cancel" :color blue)) :config (projectile-mode)
("o" projectile-multi-occur) (jdormit/define-prefix "p" "projectile") (leader-def-key "pf"
("s-p" projectile-switch-project "switch project") #'projectile-find-file) (leader-def-key "pg" #'projectile-grep)
("p" projectile-switch-project) (leader-def-key "pp" #'projectile-switch-project)
("s" projectile-switch-project) (leader-def-key "pc" #'projectile-compile-project)
("r" projectile-recentf) (leader-def-key "ph" #'hydra-projectile/body) (leader-def-key
("x" projectile-remove-known-project) "ps" #'projectile-run-shell-command-in-root) (leader-def-key
("X" projectile-cleanup-known-projects) "pa" #'projectile-run-async-shell-command-in-root)
("z" projectile-cache-current-file) (leader-def-key "p M-x" #'projectile-run-command-in-root))
("`" hydra-projectile-other-window/body "other window") #+END_SRC
("q" nil "cancel" :color blue))
:config
(projectile-mode)
(jdormit/define-prefix "p" "projectile")
(leader-def-key "pf" #'projectile-find-file)
(leader-def-key "pg" #'projectile-grep)
(leader-def-key "pp" #'projectile-switch-project)
(leader-def-key "pc" #'projectile-compile-project)
(leader-def-key "ph" #'hydra-projectile/body)
(leader-def-key "ps" #'projectile-run-shell-command-in-root)
(leader-def-key "pa" #'projectile-run-async-shell-command-in-root)
(leader-def-key "p M-x" #'projectile-run-command-in-root))
#+END_SRC
* Mode line * Mode line
* UI * UI