Watch the video on YouTube!
One of the best ways to think and work through problems is to have a written dialogue with yourself. By the end of this video, you'll know how to log your thoughts from the day, link them to existing notes, and easily review the notes for any day, all with Org Roam.
Before we start, make sure you've got Org Roam set up already.
You can get started quickly by copying the configuration below, but you'll learn more if you watch the two previous videos in the Org Roam series first:
(use-package org-roam
:ensure t
:init
(setq org-roam-v2-ack t)
:custom
(org-roam-directory "~/RoamNotes")
(org-roam-completion-everywhere t)
:bind (("C-c n l" . org-roam-buffer-toggle)
("C-c n f" . org-roam-node-find)
("C-c n i" . org-roam-node-insert)
:map org-mode-map
("C-M-i" . completion-at-point)
:map org-roam-dailies-map
("Y" . org-roam-dailies-capture-yesterday)
("T" . org-roam-dailies-capture-tomorrow))
:bind-keymap
("C-c n d" . org-roam-dailies-map)
:config
(require 'org-roam-dailies) ;; Ensure the keymap is available
(org-roam-db-autosync-mode))
Before we can create and view journal entries, we first need to make sure the folder exists.
By default, Org Roam will create daily files under the daily/ subfolder of your org-roam-directory. Let's create that folder!
If you'd like to change this folder to a different path, you can set the org-roam-dailies-directory like so:
(setq org-roam-dailies-directory "journal/")
This path must be relative to org-roam-directory!
Once you've got Org Roam configured, you can run the command org-roam-dailies-capture-today which we've bound to C-c n d n.
We're using the existing org-roam-dailies-map for key bindings!
When you run that command, a capture window will appear for a file named with the current date. Here, you can write whatever you like and then press C-c C-c to save the entry or C-c C-k to cancel the capture without saving it.
The nice thing about this command is that you can run it again to capture another entry, basically allowing you to create entries across the entire day. Let's try it!
One major benefit of using Org Roam for your journal (instead of something like org-journal) is that you can link to any other note in your Org Roam database. We can use C-c n i to insert a link to the Scheme entry that we created in a previous episode.
Perhaps you want to take a look at the journal entries you've already written for today. To do this, you can run the command org-roam-dailies-goto-today which we've bound to C-c n d d.
When you run this command, the journal file for today will be opened so that you can read it and make any edits you like.
This file is set up like any other Org Roam note. You can also use C-c n f to navigate to it and even insert a link to it in other note files!
You can also create entries for the previous or next day from today:
These commands can be useful for writing concluding thoughts for the previous day or leaving notes for yourself for tomorrow!
There are also commands to navigate to the entries for these days:
You can create or view notes for a specific day with the following commands:
When you run either of these commands, you'll be shown a calendar which lets you pick the date to view or create entries. Just hold shift and use the arrow keys to move around in the calendar!
You can also navigate forward or backward in time from the date of the file you're currently viewing:
If you want to add some more information to the entries that you capture, you can customize the default capture template:
(setq org-roam-dailies-capture-templates
'(("d" "default" entry "* %<%I:%M %p>: %?"
:if-new (file+head "%<%Y-%m-%d>.org" "#+title: %<%Y-%m-%d>\n"))))
More information on the format can be found in the documentation for format-time-string.
Now when we create a new daily entry, the date will be captured in the heading.
You can create more capture templates for daily entries! I'll give some more examples on how to use this in another video.
Here's the final configuration for everything you saw in the video:
(use-package org-roam
:ensure t
:init
(setq org-roam-v2-ack t)
:custom
(org-roam-directory "~/RoamNotes")
(org-roam-completion-everywhere t)
(org-roam-dailies-capture-templates
'(("d" "default" entry "* %<%I:%M %p>: %?"
:if-new (file+head "%<%Y-%m-%d>.org" "#+title: %<%Y-%m-%d>\n"))))
:bind (("C-c n l" . org-roam-buffer-toggle)
("C-c n f" . org-roam-node-find)
("C-c n i" . org-roam-node-insert)
:map org-mode-map
("C-M-i" . completion-at-point)
:map org-roam-dailies-map
("Y" . org-roam-dailies-capture-yesterday)
("T" . org-roam-dailies-capture-tomorrow))
:bind-keymap
("C-c n d" . org-roam-dailies-map)
:config
(require 'org-roam-dailies) ;; Ensure the keymap is available
(org-roam-db-autosync-mode))