# simple-denote.nvim **Archive note:** I've moved off Codeberg. This extension is simple and works fine. For a potentially maintained extension with built in search check out [https://github.com/cvigilv/denote.nvim](https://github.com/cvigilv/denote.nvim). This Neovim plugin provides a command `:Denote note` that prompts for a title and keywords (tags), then creates a new file in a flat notes directory using the [Emacs Denote package's file-naming scheme](https://protesilaos.com/emacs/denote#h:4e9c7512-84dc-4dfb-9fa9-e15d51178e5d): `DATE==SIGNATURE--TITLE__KEYWORDS.EXTENSION` For example: ``` 20240601T174946--how-to-tie-a-tie__lifeskills_clothes.md 20240601T180054--title-only.org 20240601T193022__only_keywords.norg 20240601T200121.txt 20240601T213392==1a1--i-have-a-signature__denote.csv ``` That's all this does: create and consistently rename text files using the above scheme. No frontmatter, links, etc. I have overcomplicated my notes too many times with fancy Org Mode and Zettelkasten systems and this is my minimalist endgame. The file-naming should be 1:1 with denote.el, down to minor things like triming/combining excess whitespace, removing special characters, disallowing multi-word keywords, and separating signature terms with = (e.g. `==three=word=sig`). # Installation / Config Example config via [lazy.nvim](https://github.com/folke/lazy.nvim) ```lua { "https://codeberg.org/historia/simple-denote.nvim", opts = { ext = "md", -- Note file extension (e.g. md, org, norg, txt) dir = "~/notes", -- Notes directory (should already exist) add_heading = true, -- Add a md/org heading to new notes retitle_heading = true, -- Replace the first line heading when retitling directories = {}, -- Optional: multiple notes directories (see below) }, }, ``` The heading options automatically support Markdown (#) and Org/Norg (*) headings. ## Keymaps Maybe you want to set keymaps for the commands as well ```lua vim.keymap.set({'n','v'}, 'nn', ":Denote note", { desc = "New note" }) vim.keymap.set({'n','v'}, 'nt', ":Denote title", { desc = "Change title" }) vim.keymap.set({'n','v'}, 'nk', ":Denote keywords", { desc = "Change keywords" }) vim.keymap.set({'n','v'}, 'nz', ":Denote signature", { desc = "Change signature" }) vim.keymap.set({'n','v'}, 'ne', ":Denote extension", { desc = "Change extension" }) vim.keymap.set({'n','v'}, 'nd', ":Denote dir", { desc = "Switch directory" }) ``` ## Manual Install To install without a plugin manager: ```bash mkdir -p ~/.local/share/nvim/site/pack/simple-denote.nvim/start cd ~/.local/share/nvim/site/pack/simple-denote.nvim/start git clone https://codeberg.org/historia/simple-denote.nvim ``` Add the following to `~/.config/nvim/init.lua` ```lua require('simple-denote').setup({ ext = "md", dir = "~/notes", add_heading = true, retitle_heading = true, }) ``` # :Denote Command ```vim " Creates a new note in the `dir` directory with `ext` extension " Keywords are space delimited. The title or keywords can be blank. :Denote note " Renames the current note with the new title " If `retitle_heading` is true, overwrites the first line heading as well :Denote title " Renames the current note with the new list of keywords (space delimited) :Denote keywords " Rename the current note with a signature " This has a user-defined meaning and no particular purpose :Denote signature " Rename the current file to a new extension :Denote extension " Switch active notes directory (requires directories = {...} config) :Denote dir ``` # Multi-Directory Support To work with multiple notes directories, add them to `directories`: ```lua require('simple-denote').setup({ dir = "~/notes", -- default active directory directories = { "~/notes", "~/work", "~/projects" }, }) ``` Use `:Denote dir` to select a directory. The active directory is exposed as `vim.g.denote_dir` so other plugins can read it. When `directories` is empty (the default), nothing changes and the plugin works identically so I don't break anything for anyone who happens to be using this. # Credits * [HumanEntity/denote.nvim](https://github.com/HumanEntity/denote.nvim) - This project was based on denote.nvim and modified to suit my personal preference or closer adhere to the original Denote spec. * [denote.el](https://protesilaos.com/emacs/denote) - The original Emacs package # License MIT