Skip to content

pcyman/second-brain.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

second-brain.nvim

Minimal helper plugin for a second-brain knowledge base in Neovim.

Features

  • Create or open today's daily note from a configured template
  • Insert templates into the current buffer with a snacks.nvim picker
  • Expand {{title}}, {{date}}, and {{time}} when inserting a template

Requirements

  • Neovim 0.9+
  • folke/snacks.nvim with picker enabled for :SecondBrainTemplate

Installation

{
  "mayumu/second-brain.nvim",
  dependencies = {
    {
      "folke/snacks.nvim",
      opts = {
        picker = { enabled = true },
      },
    },
  },
  opts = {},
}

Setup

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",
  },
}

Functions

  • :SecondBrainDaily / require("second-brain").daily_note()
  • :SecondBrainTemplate / require("second-brain").insert_template()

Template Variables

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.

About

Minimal helper plugin for a second-brain knowledge base in Neovim

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages