Dirman
Pages 45
Setting Up
For the programmer
- Writing my own module
- Hotswapping modules
- Difference between module.public and module.config.public
- Metamodules
Inbuilt modules:
core.autocommands
core.export
core.export.markdown
core.gtd.base
core.integrations.treesitter
core.keybinds
core.mode
core.neorgcmd
core.norg.completion
core.norg.concealer
core.norg.dirman
core.norg.esupports.hop
core.norg.esupports.indent
core.norg.esupports.metagen
core.norg.journal
core.norg.manoeuvre
core.norg.news
core.norg.qol.toc
core.norg.qol.todo_items
core.presenter
core.syntax
core.tangle
Clone this wiki locally
Directory manager for Neorg.
This module is be responsible for managing directories full of .norg files.
Overview
It will provide other modules the ability to see which directories the user is in, automatically changing directories, and other API bits and bobs that will allow things like telescope.nvim integration.
To use core.norg.dirman, simply load up the module in your configuration and specify the directories you want to be managed for you:
require('neorg').setup {
load = {
["core.defaults"] = {},
["core.norg.dirman"] = {
config = {
workspaces = {
my_ws = "~/neorg", -- Format: <name_of_workspace> = <path_to_workspace_root>
my_other_notes = "~/work/notes",
},
autochdir = true, -- Automatically change the directory to the current workspace's root every time
index = "index.norg", -- The name of the main (root) .norg file
}
}
}
}
To query the current workspace, run :Neorg workspace
. To set the workspace, run :Neorg workspace <workspace_name>
.
Usage
How to Apply
- To manually load the module, place this code in your Neorg setup:
Consult the configuration section to see how you can configure
["core.norg.dirman"] = { config = { -- Note that this table is optional and doesn't need to be provided -- Configuration here } }
core.norg.dirman
to your liking.
Configuration
workspaces
: The list of active workspaces
Default Value:
autochdir
: Automatically change the directory to the root of the workspace every time
Default value: false
index
: The name for the index file
Default value: "index.norg"
default_workspace
: The default workspace to load into when running :NeorgStart
This is only used whenever Neorg does not remember your previous
workspace
Default value: nil
open_last_workspace
: Whether to open the last workspace when running :NeorgStart
Default value: true
Developer Usage
Public API
This segment will detail all of the functions core.norg.dirman
exposes. All of these functions reside in the public
table.
open_file
get_workspaces
get_workspace_names
get_current_workspace
set_workspace
create_file
file_exists
get_file_bufnr
get_norg_files
sync
get_workspace_match
touch_file
open_workspace
add_workspace
set_last_workspace
update_cwd
get_workspace
Examples
None Provided
Extra Info
Version
This module supports at least version 0.0.11. The current Neorg version is 0.0.11.
Imports
This module does not import any other files.
Requires
-
core.autocommands
- Handles the creation and management of Neovim's autocommands. -
core.neorgcmd
- This module deals with handling everything related to the:Neorg
command. -
core.keybinds
- Module for managing keybindings with Neorg mode support. -
core.ui
- A set of public functions to help developers create and manage UI (selection popups, prompts...) in their modules. -
core.storage
- Deals with storing persistent data across Neorg sessions.
Required by
-
core.norg.journal
- Easily create files for a journal. -
core.gtd.base
- Manages your tasks with Neorg using the Getting Things Done methodology. -
core.gtd.helpers
- Nice helpers for GTD modules. -
core.gtd.queries
- Gets tasks, projects and useful information for the GTD system. -
core.gtd.ui
- Nicely displays GTD related information.