Sonar's Greenhouse

Doom Emacs: A Promising Start

Introduction

I’ve made a lot of progress since my initial post on this project. While trying to migrate all the things I mentioned in my previous post is obviously a massive endeavor, I’m amazed at what I’ve done already.

I’m happy to report that I’m currently writing this post from inside Doom Emacs, if that’s any preview of what’s been accomplished in just the three days since I first began working with Doom Emacs.

Replacing the Vault

Initially, I spread myself too thin on my research. All of the things I wanted to incorporate into my Emacs setup were in my head in parallel, and the feeling that I was in over my head was increasing. However, I couldn’t give up, not so soon, not with the self-imposed obligation of another blog post hanging over my head.

So I simplified. I already knew about org-roam, and had seen a glimpse of what power it offered. It seemed like the best way to replace my existing Obsidian knowledge-management workflow, so I decided to start there.

After some time with the org-roam user manual, I found the developer’s own blog post on taking smart notes with org-roam. The power I saw on display was inspiring, but reading documentation and blog posts wasn’t getting me anywhere, so I resolved to simply try to start using it.

I enabled roam v2 in my init.el, and set a few configurations in config.el to point org-mode and org-roam to the directories I wanted:

(setq org-directory "~/Documents/org/")
(setq org-roam-directory "~/Documents/org/roam/")

In the course of my research, I’d found an interesting but unrelated Wikipedia page, so I decided to punch that in as a start. Entering SPC n r n pulled up a pop-up buffer at the bottom of the screen, which pre-filled a title property for the file, generated an ID, and dropped my point right in to start typing. A further C-c C-c promptly saved the node to my roam directory for future use. Amazing!

Over the course of the next several hours, I started working on taking notes as I normally would in Obsidian on the Doom Emacs project using the roam tools instead. Though the keybindings took a little getting used to, and I often had to reference various documentation, it quickly became effortless to perform basic operations with Emacs and org-roam itself.

I won’t go into every functionality used here, but I’m not doing anything fancy - just creating, linking, editing, and searching nodes. I’m not following a classical or strict Zettelkasten method, but I am adapting my use to take better advantage of the available tools.

All the functions I wanted - tagging, full text search, internal links, etc - are all present out of the box with org-roam, and are blazing fast. The full text search in particular is very impressive, with essentially no perceptible delay between when I begin typing and when I can see a list of all instances of my search.

Daily Journaling

After figuring out org-roam and getting it to a basic, workable state, I discovered an extension for it that I wanted to use - org-roam-dailies. It was already included, so all I had to do was point to where I wanted my dailies to go, and create a default template:

(setq org-roam-dailies-directory "daily/")
(setq org-roam-dailies-capture-templates
      '(("d" "default" entry
         "* %?"
         :target (file+head "%<%Y-%m-%d>.org"
                            "#+title: %<%Y-%m-%d>\n"))))

With this, now I could hit SPC n r d t, and a daily file would automatically be created for today! Again, the relevant details for roam were automatically populated.

I found references to a number of different approaches for using these daily files, but ultimately decided to adopt my own - I am building a tool for my use, after all.

Having recently adopted the practice of 750 Words a Day, I decided that these dailies would first house my daily words. I’m not using the website itself, just the practice as a personal tool, so I didn’t need anything fancy. The words would simply go into their own heading, and typed out in the morning as I’d been doing.

Though not interested in the full statistics offered by the 750 Words website, I did want to know how long the words were taking. For this, I found an easy solution already included in Emacs, the clock-in and clock-out functions.

Once under the * 750 Words heading, I could simply hit SPC m c i, at which point a LOGBOOK: drawer would be created at the top of the heading. The time I clocked-in was automatically appended into the drawer, and a running time displayed on the mode line. Once finished, SPC m c o would clock me out of the task, adding a finished time to the log and calculating the total time spent.

After my daily words, I’d simply use the daily file for whatever felt right. So far, that’s included a “running log” which I use to ramble out thoughts and processes that don’t belong anywhere else, as well as specific temporary notes that I’d immediately turn into other things, and at the end of the day, a reflection and some planning for the next day.

Already, the system felt absolutely incredible. I was quickly learning to navigate the interface, use the functions of my roam, and configure things to my liking.

Task Management

Once my org was in a workable state, it felt like a natural transition to try to incorporate some task management // to-do list functionality into the situation. I toyed with a couple ideas for this.

Familiarizing myself a little with org-agenda revealed that any org file could simply be added to the agenda files list, thus allowing me to create tasks inline with whatever I was working on and have them propagate to my agenda. This seemed cool, but ultimately the idea of having tasks cluttered across a bunch of files made me uncomfortable.

Next, I considered using the built in org-capture with the default Doom templates for task management. This would append tasks to a single file in my main org directory each time I captured a task. While this seemed fine, I decided I wanted my tasks to be a little more incorporated with my roam specifically.

The approach I settled on was to create some new templates:

(after! org
  (setq org-capture-templates
        '(("t" "General TODO" entry
           (file+headline "~/Documents/org/roam/todo.org" "Tasks")
           "* TODO %? %^g\n %T")
          ("r" "Related TODO" entry
           (file+headline "~/Documents/org/roam/todo.org" "Tasks")
           "* TODO %? %^g\n %T\n %i%a")
          ("l" "Generial REVIEW" entry
           (file+headline "~/Documents/org/roam/todo.org" "Review")
           "* REVIEW %? %^g\n %T")
          ("h" "Related REVIEW" entry
           (file+headline "~/Documents/org/roam/todo.org" "Review")
           "* REVIEW %? %^g\n %T\n %i%a")

Similar to the defaults, these simply append new to-do items to a single file, but pointed into my roam directory instead of my main org directory, allowing roam to interact with the file. I also created separate “relevant” and “general” templates. The “relevant” templates include a link to the section of the org file I was working in when the capture was called, while the “general” just creates a task with no link. Each template also prompts for a tag or tags, allowing me to filter org-agenda views by these tags if I just want to see tasks related to a particular area.

The “review” templates felt like a good idea when I created them, in case I wanted to specifically come back to something that wasn’t strictly a task, but I haven’t found a ton of use for them yet. I’m leaving them in for now, in case they come in handy later on, but they may ultimately get deleted.

Now, all it took was adding this /org/roam/todo.org file to my org-agenda with C-c [, and all TODO entries would now be found by org-agenda. Boom, task management implemented.

Incorporating my Website

I was already amazed with my progress. All the functionalities from two apps, Obsidian and Planner, were now up and running with even more power inside Emacs, and at every turn I was struck by how incredible the whole thing was.

I new that the next step was to add a way to work on my website, so I looked into my options. Two Emacs packages specifically for Hugo were available - ox-hugo and easy-hugo. The former was simply an org-export extension that allowed for the export of org files into Hugo-tailored markdown, while the latter seemed to offer a full Hugo major mode to work with all aspects of the site generator.

While these both seemed very useful, I’ve ultimately decided to use neither for now. I’m perfectly happy writing my posts in markdown, and easy-hugo seemed like overkill for the fairly simple workflow I have for my site. Plus, with magit’s powerful git interface included by default with Doom, pushing to my repository was already possible.

The only extension I did end up adding for the purposes of this was treemacs, which was simply a matter of uncommenting the line in my init.el file.

The setup was easy. I opened a new workspace with SPC TAB N, switched to the project folder for my website with SPC p p, opened the treemacs sidebar with SPC o p, then called up a terminal and the magit overview.

The end result looked very similar to my Code-OSS workspace, with the magit buffer in place of a browser preview. I may eventually add a browser buffer into my Emacs setup, but for now it doesn’t really matter, since Hugo can already run a local server to look at from FireFox or anywhere else.

All this brings us to here, now, me, writing this blog post right from inside Emacs! It remains to be seen whether I’ll be able to get magit to work as-is, but I can’t imagine it will be particularly difficult.

The Road Ahead

My work so far has been stunning. The ease of use I’m already experiencing is pretty incredible, and it will only improve as I learn and internalize more and more keybindings. Already, I’ve found myself trying to use the Doom keybindings in other applications, and I suspect that will only increase.

At this point, there are a few things I’d like to polish up before I start working on implementing any new workflows into Doom Emacs.

First, I need to migrate my existing vault into org-roam. There appear to be some tools available, but I’m honestly thinking I’ll just do it by hand. This will allow me to evaluate if there are any more needs for the roam I haven’t considered, and adjust the contents of my vault to fit some of the new powers that come along with Emacs in general.

After this, I’d like to improve my task management a little more. The default agenda views are fine for the time being, but ultimately I think I’ll use org-super-agenda to get a little more granular control over sorting and viewing my tasks.

I’m also toying with the idea of using metrics-tracker to do some habit tracking using the built-in Emacs diary, but if I find an implementation that allows me to do this tracking from within roam I’d prefer that.

The other productivity detail I may also add in is org-pomodoro, to have mode line time tracking without clocking into individual tasks to hopefully allow me to manage my time a little better as I begin to use Emacs for more and more things.

Finally, I’d just like to do a little more polishing. Things like session saving to make start up and shut down easier, learning a few more navigation keybindings, and overall taking better advantage of the power now in my hands, will all go a long way towards further improving my experience.

Closing Notes

I haven’t gone into nearly the full detail of everything I’ve learned and done so far, but this post is already longer than I meant for it to be. It’s at least a good overview of my progress so far, and I’m happy with the state of things.

I’ll continue to post updates as things go on!

Stay tuned, do good work, and be kind.

Thank you for reading.

~Sonar

#emacs #linux