Organize Neorg Notes Across Projects with core.dirman Workspaces
Configure multiple Neorg workspaces in core.dirman, switch between them, and verify where journals and links resolve.
27 Jul 2025, 18:56 UTC

Notes keep appearing in the wrong directory
You start a Neorg journal entry expecting it to live beside your project notes, but it lands in a default folder you do not use. Links resolve relative to the wrong root, and opening :Neorg journal creates files outside your active project. This usually happens because Neorg has no explicit workspace configured, or because the active workspace does not match the directory you are editing.
A workspace in Neorg is a directory tree treated as a notes root. core.dirman tracks the workspace index file and metadata. Without a declared workspace, Neorg cannot reliably decide where new files and links should resolve by default.
Declare workspaces in Lua config
Add workspace definitions to your Neovim configuration. Paths should be absolute so behavior does not depend on Neovim's current working directory. The exact table shape can change between Neorg releases, so check your installed version's documentation before copying.
-- Example structure; verify keys against your Neorg version
user.modules = {
['core.dirman'] = {
config = {
workspaces = {
{ name = 'work', directory = '/home/you/notes/work' },
{ name = 'personal', directory = '/home/you/notes/personal' },
},
default_workspace = 'work',
},
},
}
Create an index.norg file inside each workspace directory. core.dirman uses that file as the workspace root document. If the file is missing, workspace operations may fail or fall back to an unexpected location.
Switch workspaces and verify placement
Run commands inside Neovim. No elevated permissions are required; you only need read and write access to the workspace directories.
- Open Neovim and run
:Neorg workspace. The picker should listworkandpersonal. - Select a workspace, then run
:set filetype?. It should reportnorgif tree-sitter and the norg parser are installed. - Run
:Neorg journal. Confirm the new file appears inside the active workspace directory, not in a global notes folder.
If :set filetype? returns something else, another plugin may be hijacking .norg filetype detection. Check for competing org-mode plugins and disable or reorder them as needed.
Trade-offs and limitations
- Neorg is actively developed; module names and config keys may change between releases.
- Relative workspace directories can break when Neovim starts from a different directory. Use absolute paths.
- You need Neovim 0.8+, Lua, and tree-sitter with the norg parser for syntax highlighting and text objects.
- Only one workspace is active at a time. Links and journals resolve relative to that active workspace.
Practical check before you rely on it
Open your config and confirm user.modules['core.dirman'] lists valid directory paths. Then run :Neorg workspace and :Neorg journal from inside Neovim. If the journal file appears inside the expected workspace directory, the configuration is working. If not, inspect the workspace path for typos and confirm index.norg exists in that directory.
Editing init.lua is reversible: remove or comment out the workspaces block to return to the previous behavior. There is no database migration or permanent state change beyond your config file.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.