-
-
Notifications
You must be signed in to change notification settings - Fork 233
Metagen
github-actions[bot] edited this page Mar 29, 2025
·
368 revisions
The metagen module automatically places relevant metadata at the top of your .norg files.
The metagen module exposes two commands - :Neorg inject-metadata and :Neorg update-metadata.
- The
inject-metadatacommand will remove any existing metadata and overwrite it with fresh information. - The
update-metadatapreserves existing info, updating things like theupdatedfields (when the file was last edited) as well as a few other non-destructive fields.
-
(nil)
Custom template to use for generating content inside
@document.metatag The template is a list of lists, each defining a key-value pair of metadataExample:
template = { -- Default field name without a value will fall back to the default behavior { "title" }, -- Set a custom value for "authors" field { "authors", "Vhyrro" }, -- Fields can be set by lua functions { "categories", function() return {"Category-1", "Category-2"} end } }default_template -
(boolean)
Whether or not to call
:h :undojoinjust before changing the timestamp inupdate_metadata. This will make your undo key undo the last change before writing the file in addition to the timestamp change. This will move your cursor to the top of the file. For users with an autosave plugin, this option must be paired with keybinds for undo/redo to avoid problems with undo tree branching:vim.keymap.set("n", "u", function() require("neorg.modules").get_module("core.esupports.metagen").skip_next_update() local k = vim.api.nvim_replace_termcodes("u<c-o>", true, false, true) vim.api.nvim_feedkeys(k, 'n', false) end) vim.keymap.set("n", "<C-r>", function() require("neorg.modules").get_module("core.esupports.metagen").skip_next_update() local k = vim.api.nvim_replace_termcodes("<c-r><c-o>", true, false, true) vim.api.nvim_feedkeys(k, 'n', false) end)
false
-
core.autocommands- Handles the creation and management of Neovim's autocommands. -
core.integrations.treesitter- A module designed to integrate Treesitter into Neorg.
core.autocommandscore.clipboardcore.clipboard.code-blockscore.completioncore.concealercore.defaultscore.dirmancore.dirman.utilscore.esupports.hopcore.esupports.indentcore.esupports.metagencore.exportcore.export.htmlcore.export.markdowncore.fscore.highlightscore.integrations.coq_nvimcore.integrations.nvim-cmpcore.integrations.nvim-compecore.integrations.treesittercore.iterocore.journalcore.keybindscore.latex.renderercore.looking-glasscore.neorgcmdcore.neorgcmd.commands.returncore.pivotcore.presentercore.promocore.qol.toccore.qol.todo_itemscore.queries.nativecore.scannercore.storagecore.summarycore.syntaxcore.tanglecore.tempuscore.text-objectscore.todo-introspectorcore.uicore.ui.calendar