I understand that it seems confusing with too much information, which does not seem to provide consistent and unified view. Don’t worry. Everyone has been there, and once you have grasped a few basics, it should not be too hard from then on.
Doom is not vanilla Emacs
But the first thing first. If you have chosen to use Doom Emacs, then I suggest you focus on Doom-specific tutorials and ignore all the tutorials that are not Doom-specific. At least when you have just started out, focus on Doom (or the basic Emacs). This is because Doom has its own layers of “package management” and “configuration”, which are so distinct from the basic Emacs (often called “vanilla Emacs” as opposed to Doom Emacs) that the knowledge of the vanilla Emacs may not directly help beginner Doom Emacs users.
I realize Doom is popular as a starter kit now, though I don’t find it particularly easy for a complete beginner. I am not trying to dissuade you. You just need to spend some time to learn Emacs + Doom from the community of Doom users. Perhaps this FAQ from Doom GitHub will help you settle in (or choose to leave the Doom camp). I was told once that they are responsive and helpful. As for me, I used Doom for a few months. Together with Spacemacs, both of them have made me realize how far you could get with Emacs. I ultimately decided to come back to the vanilla – I use Emacs only to write notes and code Emacs for note-taking. Doom felt too much for my minimal use.
Package Management and Modules (org +roam2)
in Doom
I suggest you read the sections named Configure and Package management in the Getting Started guide in the Doom’s own GitHub repository carefully.
init.el
Where you’ll find your doom! block, which controls what Doom modules are enabled and in what order they will be loaded.
This file is evaluated early when Emacs is starting up; before any other module has loaded. You generally shouldn’t add code to this file unless you’re targeting Doom’s CLI or something that needs to be configured very early in the startup process.
config.el
Here is where 99.99% of your private configuration should go. Anything in here is evaluated after all other modules have loaded, when starting up Emacs.
packages.el
Package management is done from this file; where you’ll declare what packages to install and where from.
Doom Emacs does not use package.el (the package manager built into Emacs). Instead, it uses its own declarative package manager built on top of straight.el.
As for (org +roam2)
, that’s using a module in init.el
. A module is explained as below:
A Doom module is a bundle of packages, configuration and commands, organized into a unit that can be toggled easily by tweaking your doom! block".
So you activated the org
module with passing the +roam2
flag. You have got a couple of packages installed in your system with straight.el
and default configuration as defined by the Doom module.
Where do we put configuration ?
By my own reading of the documentation (and my experience), if you need any additional configuration on top of what the module provides, you put it in config.el
. I believe you then need to use CLI command doom sync
(please consult Doom’s documentation further on this).
Read README on Org-roam GitHub
In addition to the Doom’s official documentation, you can also confirm the same understanding in this part of README in Org-roam GitHub repo. Below is a screen capture.You need to toggle the instructions to expand it.