Doom Emacs
Last updated:
This is my guide for getting started with Doom Emacs as a complete noob.
I know there are a ton of videos on YouTube and a lot of content out there, but nothing seemed to give me that “Hello world!” experience I am used to when trying out new things. This guide is here to solve that.
Installation
There is no point in me repeating the installation instructions since the Doom Emacs official “Getting Started” covers way more than I ever could.
The only to remember is this:
- Install Emacs & Dependencies
- Install Doom Emacs
That’s it.
They also recommend running doom doctor
after if it’s you’re first time. I would do this if I were you.
This will identify any missing dependencies and prevent issue when we run Doom Emacs.
Troubleshooting
There were a couple issues I ran into after following the installation steps for macOS.
doom not found in PATH
It’s supposed to add it for you, but maybe my zsh configuration is wonky and messed that up. To fix, run this from the terminal:
path+=($HOME/.emacs.d/bin)
couldn’t find marked
I don’t remember the exact error, but I was missing a package/dependency called marked
. To fix, install with npm/yarn:
npm i -g marked
yarn global add marked
Figured it out thanks to this issue.
fontconfig isn’t installed
unable to detect fonts because fontconfig isn’t installed
To fix, install with brew using:
brew install fontconfig
Hello, Doom Emacs
The first thing I do in any new technology or program is the famous, “Hello world!“.
To do that in Doom, do the following:
- Open Emacs
- Hit
SPC b N
— create new empty buffer - Type “Hello, Doom Emacs!”
- Hit
SPC b s
- save buffer (use default location or pick) - Type in name of file — hello.txt
- Hit enter
Boom! You’ve created your first file with Doom Emacs.
Note: I like to think of a buffer as a scratchpad. It exists in memory but has not yet been written to disk as a file.
Return to Start
After you’ve created this file, you probably want to close it.
To do so, we have to clear the frame. Hit SPC q F
.
This will bring you back to the start with the Doom logo.
How to
A list of things you might be wondering how you can do.
Auto-save Buffers
I felt annoyed that I had to save my buffer every so often. Well turns out you can turn on auto-save.
Using this below, it auto-saves every 15 seconds.
- Open your config:
.doom.d/config.el
- Add this block:
;; This is so buffers auto-save ;; auto save (setq auto-save-visited-interval 15) (auto-save-visited-mode +1)
- Restart Doom
Fix M-RET in org-mode
If you’re like me and you want it to add a new item when hitting return
in a bulleted list, you can use a package called org-autolist
.
- Add the package inside
.doom.d/packages.el
(package! org-autolist)
- Add this to your
config.el
(add-hook 'org-mode-hook
(lambda () (org-autolist-mode)))
- Close Doom and run
doom build
- Open Doom and voilà, it works!
Resources
Here are a list of handy resources:
- Doom Emacs Cheatsheet
- Time Parsing - useful for inserting time-related values into your snippets
- Focus on a Single Org SubTree