It has been a wild journey to say the least, in figuring out how to install and set-up Org-Roam and it doesn’t help that I’m also new to Linux. But I wanted to see what all the hype was about, especially after doing all this research to find a great tool (you can find my thoughts on this in my previous post titled "A Digitized Second Brain".
Luckily, with some help from wonderful online guides and people on discord, I’ve put together the steps to get Org-Roam on Doom Emacs, which may result in the easiest installation. All steps were done in Ubuntu but should be applicable to other Linux Distros as well. Nevertheless, I hope you find this guide helpful.
Download using the following:
sudo apt-get install emacs
We are going to use Doom Emacs for this because of the easy installation of using a ‘+ roam’ flag (steps explained below). Go ahead and clone their github repo:
git clone https://github.com/hlissner/doom-emacs ~/.emacs.d
Add Emacs to your PATH
If you know what you are doing, follow the quick version. Otherwise, the detailed instructions are below.
inside your .bash_profile
cdto go to your home directory. Verify you are there by typing
pwdwhich should print out /home/’your user name’
ls -ato list all files, including hidden
- you should see ‘.bashrc’ in your list. You can open it with
vi .bashrc. This lets you go into the .bashrc using a text editor.
- Another way of doing this is typing in
vi ~/.bashrc. The
~/is basically shorthand for /home/’yourusername’. Doing the previous steps was the longer way.
- use your down arrow key to move the cursor all the way down to the last line. No need to press
owhich adds a line below the last one. Now you will be able to edit.
- Now you can add
export PATH=$PATH:~/.emacs.d/binby etiher copying from here and using
ctrl + shift + vto paste into your file or by manually typing it in. when you paste. It shouldn’t be indented or anything,
- now to exit and save the file, press the
esckey and then type
:xto save and exit the file.
- If you mess up or want to exit without saving, don’t press ‘enter’ or anything. Press the
escbutton and then type
:q!. Now you can repeat the steps above from
vi ~/.bashrcto try again.
- vi is a bit confusing. Here is a helpful cheatsheet for reference.
- One more step left! You have to actually load this new path into your current secession. Meaning you have to actually activate this into the terminal that you are using. type
source ~/.bashrcto do so.
By completing all of the steps above to add Doom Emacs to your path, you’ve ensured you can run the program from whatever directory you are currently in, whether it’s your Emacs folder, music, documents, etc.
Also, this is a helpful article on understanding PATH in Linux
At this point, you can go to your Applications on your linux desktop, search for Emacs, and click on "Emacs (GUI)" which should open to Doom Emacs!
Adding Org Roam To Your Config
Now that you are entering the Emacs world, certain keyboard short cuts won’t work so I’ve provided a basic way to get started. Here are some references you should have up next to your Emacs:
- Survival Emacs Read this short guide before you continue or have it up side by side with you Doom Emacs Note:The rest of the setup will use commands from this guide
- The GNU Emacs Reference card and the Doom Emacs Cheatsheet are helpful for future reference as you get started on Emacs after installation but can also be used now just in case. The "Survival Emacs" is more important to have up right now.
‘init.el f’ file
- Go to "open private configuration" on the front page menu. You can also use
*space* f p(one at a time, not how you hold down keys for shortcuts)
- Go into the
- scroll down to around line 144, until you see ‘org’ on a line
ito enable editing and then add
orgname so it reads like this:
- to save: type
escto get out of editing mode. Then type
C-sto save which you can type
y. Then type
C-cto quit out of Emacs.
- You need to sync these changes. Open up the terminal and run
- Now you can reopen Doom Emacs
- Now type
spc f pto go into the config.el file
- more importantly, you need to add the directory of your files. scroll down to around line 32 where where you will see
- Underneath it add
setq org-roam-directory. Type this in instead of copy and pasting since the org-roam_directory option should come up while you are typing. If not, then you may have to fix an error from earlier
- Add your destination the the new line you’ve typed For example, this is mine: (setq org-roam-directory "~/Documents/Second_brain"):
- You can open the command line and create a folder before you add and save this destination
- Note: You can also add Doom themes in the config file
Test out setup
At this point you are done! You can access all of the Roam commands with
spc n r. If you type these slowly, you will see how the navigation works to get to org-roam.
This post shows the basics of getting started but I would recommend checking out this post Own Your Second Brain to see how to add it some useful features like Bidirectional Link Auto Complete. His post was the reason I was able to come up with this guide, and followed along for most of it for my own installation. Of course, the Org-Roam website is also a good place to go next.
It’s amazing how much you can really customize Emacs, everything from functionalities to asthetics. It also has a wonderful online community that is willing to help and constantly uprade Org-Roam to make it the best version of itself. Whether you are Migrating from Roam Reseach or starting fresh with the Zettelkasten method, hopefully Org-Roam is an exciting start into your documentation.