Stop procrastinating with note taking and start org-roam

I didn’t use to like taking notes but now I like it. When reading something interesting in a book I will take a pause, write it down, or if I encounter a bug while programming I will document how I solved this bug . The thought is that if I can organize all my knowledge into a “second brain” then that will allow me to be more productive.

However I did not end up being more productive, in fact I suddenly got even less stuff done because I spent too much time writing and organizing my notes. Years later I finally have a note taking system that works well for me and is actually useful in my day to day life.

My old wishlist

When I started my search for a note taking software I didn’t have a lot requirements, some of the features I wanted was.

  • Sync my notes between machines
  • Organize my notes in different hierarchy
  • Kanban board support

What I tried

Notion

The first app that I tried for note taking was Notion which at first I was happy with it. I used Notion for a couple of months, spent tons of hours making sure everything looked just how I wanted it to, which I succeeded with.

Figure 1: Notion dashboard example

Figure 1: Notion dashboard example

However I soon started to encounter problems that I could just not accept, pages were loading slowly and sometimes would not load at all. Even though I enjoyed not having to sync my notes between devices because it was always online I came to conclude that I need something to run locally on my devices.

Pros

  • Customizable to look really cool
  • Always online so syncing between machines is no problem
  • Community made templates

Cons

  • Can sometimes be slow
  • Sometimes some pages won’t load
  • Navigation between pages is not as smooth as it could be
  • Always online, what if I lose internet?

Obsidian

Another app that I had heard a lot about at the time was Obsidian. It was often mentioned as an offline alternative to Notion. This sounded great to me because I hated the latency and other problems that came with Notion always being online. Another benefit with this was that Obsidian supports community created plugins, and there is a lot of them.

At first I was happy with Obsidian, it fixed a lot of the problems that I had with Notion, having all my files locally on computer is great because it decreases the latency and the files are in markdown format so even if I were to stop using Obsidian in the future I can still use my markdown files in other applications. This makes Obsidian future proof (or at least the notes written in Obsidian is future proof) which Notion is not.

Figure 2: Obsidian example

Figure 2: Obsidian example

Because the files are not automatically synced to the cloud I needed another solution. Obsidian does support cloud sync however it cost 8$ a month but I can solve that for free.

I decided to go with git to sync my notes. This comes with some benefits and disadvantages, the disadvantages is that I need to manually commit my changes. I do this when writing code so I find it acceptable, it takes a couple of seconds at the end of the day.

But the benefits of using git to sync my notes is actually substantial, because git is not just a tool for syncing but it’s a version control system. So using git allows me to revisit the history of my notes.

Pros

  • Not always online, so no problem if I lose internet and lower latency
  • Lots of community plugins
  • Customizable to look really cool, but not as easily as in Notion
  • Plain text file format which is future proof to work with other applications

Cons

  • Built in syncing cost 8$ a month
  • Built using Electron (I won’t go in to why I don’t like Electron in this blog post)

One last problem

There is one other problem that Notion and Obisian share, and it’s a subjective opinion that I have (but I bet I could convince you objectively). That is that I hate the normal windows keybindings and prefer the emacs keybindings. In fact I have a general dislike of having to use the mouse in my workflow.

So after all of these problems I came up with a new wishlist.

My new wishlist

  • Emacs keybindings
  • Mouse not needed
  • Sync my notes between machines
  • Speed
  • Self hosted
  • Kanban board support
  • Zettelkasten method
  • Future-proof
  • Plain text files
  • Open source

What I found

After testing these alternatives my list of desired features kept increasing and I got less and less happy with using Obsidian. Also around this time I started using emacs as my IDE instead of VS Code, while playing around with different emacs packages I came across org-mode and org-roam. This seemed to be the answer to all of my note taking problems.

Org-mode

Org-mode is the go-to note taking package in emacs. Just like Obsidian org-mode uses plain text files, however where Obisian uses .md files org-mode uses .org files. Both of these formats use plain text so it’s easy to convert between the different formats. There are plenty of tools you can find online to convert between .md and .org.

Figure 3: Org agenda screenshot

Figure 3: Org agenda screenshot

If you want to learn more about org-mode I strongly recommend Carsten Dominiks (creating of org-mode) talk at google techtalks here Carsten Dominiks on org-mode at google techtalks.

Future proof data, not tools

When I switched from Notion to Obsidian there was no easy way for me to transfer my notes from Notion to Obsidian, but because both Obsidian and Org mode uses plain text files I only had to find a script that could convert my .md files into .org files. This demonstrates why it’s good to keep all your notes in plain text files. Because even though I stopped using Obisian my notes did not become obsolete.

Here is an example showing how to create a header with some text and a sub heading with text in both markdown and org.

# Heading
The above is a markdown heading and this is normal text.
## Sub heading
The above is a markdown sub-heading.
* Heading
The above is a markdown heading and this is normal text.
** Sub heading
The above is a markdown sub-heading.

Syncing

I still use git to sync my notes between devices just like I did in Obsidian. I have been playing with the thought of automatically syncing my notes using Nextcloud which I host in my home lab. However I don’t want to lose the version control features that git is providing me as well as file history. Also because I use emacs I can use the emacs package magit which is a great package to manage git.

Org agenda and TODO or not TODO

One of the strengths with org-mode is how easy it is to convert plain text into TODOs. To create a TODO you just have to add the text ‘TODO’ to the start of a heading.

* TODO Write blog post why dbt is awesome

It’s also possible to set deadlines and tags to the TODOs.

* TODO Write blog post why dbt is awesome <2023-08-11 Wed>       :tag:

So now you have a couple of org-mode documents with TODOs scattered around these files and you want some way to see all your TODOs. This is what org-agenda is for, it provides an overview of all your TODO entries and list them in a window (buffer in emacs).

Figure 4: Org agenda screenshot

Figure 4: Org agenda screenshot

Emacs keybindings

Using org mode inside of Emacs solves the problem with not using the emacs keybindings, if you don’t like emacs keybindings then it’s also possible to use evil mode in emacs to get vim style keybindings. I won’t go in to why I prefer emacs keybindings in this post but to be able to use the same keybindings when coding and writing makes life much easier.

Pros

  • Store files locally on device
  • Plain text file format (.org)
  • Emacs or vim keybindings
  • Highly customizable
  • Open source
  • Fast
  • Packages to add functionality
  • Easy to manage and track todos.

Cons

  • Need to manually sync notes between devices

Org-roam

For me org-mode is not really complete without org-roam. Org-roam amplifies org-mode by adding features from Roam to org-mode. Org-roam uses the Zettelkasten method for note taking, that is structuring notes in a non-hierarchical way and instead use links between notes to connect them.

Storing files in a hirarchy seems great at first, in fact that was a feature that I had on my first wish list, but as your notes keep growing it soon becomes unmanageable. Lets take a look at an example, imagine we have the following hirarchy of notes.

/notes/
  /emacs/
    /org-mode/
      org-note-1.org
      org-note-2.org
  /blog-posts/
    blog-post-1.org
    blog-post-2.org

This hirarchy may seem fine at first, but where should I put this blog post? It is a blog post so it certainly fits under blog-posts but it’s also about org-mode so it could also fit under emacs/org-mode. Because of this I decided that a file hirarchy was not working for me.

So how does org-roam solve this? Start by replacing each folder with a .org file and give it a title and id. Because org-roam uses links to connect notes we need files to link to, so now our blog post can link to both org-mode.org and blog-posts.org.

If you want to find all the files that link to org-mode.org then you open that file and open the org-roam-buffer using M-m a o r l or org-roam-buffer-toggle to see all the backlinks.

Linking between notes

As I said previously org-roam uses links between notes to organize them and while it’s possible to link to other files like this [[LINK][DESCRIPTION]] where ‘LINK’ is the path to the file. However this is not how org-roam wants you to link between files. Org-roam creates a database to keep track of all your files and links between them and any links between files that made using the file path will be ignore when building the database. Instead org-roam uses unique ids to identify each file which is added as a property to each file.

Note taking templates

Org-roam also makes it much easier to create new notes using capture templates which lets you create templates for creating new notes. (If not using the org-roam capture templates to create notes you can also use C-c n I (or M-x org-id-get-create)in emacs to add id to a file.

The following is an example of the most basic org-roam file.

:PROPERTIES:
:ID:       3934f8da-567b-4b88-848d-c03f9d9ba356
:END:
#+title: Note title

However you can configure the capture templates to add even more information such as author and date, the following is an example of a org-roam file created with a little more advances capture template.

:PROPERTIES:
:ID:       3934f8da-567b-4b88-848d-c03f9d9ba356
:END:
#+title: Note title
#+author: Jens
#+date: <2023-08-15 Tue>

This is all great but there is one more reason why creating your notes using org-roam is more convenient then manually creating the file. It’s a small detail but org-roam keeps all the files in one folder, so when you use org-roam to create your notes they are automatically places inside the correct folder. This is helpful because no matter what project you have open in emacs you can create a note and you know it will be places correctly next to your other org files.

Additional packages

There are plenty of more emacs packages made to supercharge org-mode. I will list some of the ones that I think is useful.

org-super-agenda

Org-super-agenda lets you customize the agenda buffer (window in emacs), I use this to have different org-agenda buffers for work and my personal life. I also sort all of my todos based on their tags.

Figure 5: Org-super-agenda screenshot

Figure 5: Org-super-agenda screenshot

org-roam-ui

While not something that I use daily as the other org-roam packages the org-roam-ui package is really useful to get a cool overview of your org-roam notes. The package creates a web server that you can connect to in the browser and it shows a graph of all your notes and their connections.

Figure 6: Org-roam-ui screenshot

Figure 6: Org-roam-ui screenshot

Honorable mentions

anytype.io

Recently I found an open source alternative to Notion called anytype, it’s similar to Notion except that it seems to fix a lot of the problems that I have had with Notion. With anytype you have all your files on your local device but can sync between devices using peer-to-peer. If Notion seems interesting to you that I would recommend to try out anytype first.

Conclusion

I have tried different note taking applications but emacs with org-mode and org-roam is when i first found something that can actually make me more productive instead of spending too much time organizing my notes and making my notes look good. It allows me to easily create new notes and TODOs and organize them in a customizable dashboard. Because it’s in emacs it also let me do everything just using keybindings.

This post is written in org-mode and org-roam using ox-hugo to convert from .org to .md and later converting the markdown file to html.

Jens Lordén

Code, ML, MLOps, data and coffee


By [Jens], 2023-08-20