Minimal helper plugin for a second-brain knowledge base in Neovim.
- Create or open today's daily note from a configured template
- Insert templates into the current buffer with a
snacks.nvimpicker - Expand
{{title}},{{date}}, and{{time}}when inserting a template
- Neovim 0.9+
folke/snacks.nvimwithpickerenabled for:SecondBrainTemplate
{
"mayumu/second-brain.nvim",
dependencies = {
{
"folke/snacks.nvim",
opts = {
picker = { enabled = true },
},
},
},
opts = {},
}require("second-brain").setup({
daily = {
dir = "daily",
filename = "%Y-%m-%d.md",
template = "templates/daily.md",
},
templates = {
dir = "templates",
},
})Default values:
{
daily = {
dir = "daily",
filename = "%Y-%m-%d.md",
template = "templates/daily.md",
},
templates = {
dir = "templates",
},
}:SecondBrainDaily/require("second-brain").daily_note():SecondBrainTemplate/require("second-brain").insert_template()
SecondBrainTemplate expands a small set of variables before inserting text:
{{title}}: current buffer filename without extension{{date}}: current date as%Y-%m-%d{{time}}: current time as%H:%M
Unknown variables are left unchanged.