A Neovim plugin that automatically maintains an index file for your daily notes in Markdown format.
- Automatically updates an index file when you save a new daily note
- Organizes entries by year and month
- Creates chronologically sorted links with day names
- Detects daily notes based on date patterns in filenames
- Configurable folder paths and index filename
- Neovim 0.11.0 or later
Using lazy.nvim
{
"bilyes/daily-notes-index.nvim",
opts = {
daily_notes_folder = "~/Documents/daily-notes",
index_filename = "index.md",
index_title = "Daily Notes Index",
}
}Using packer.nvim
use {
"bilyes/daily-notes-index.nvim",
config = function()
require("daily-notes-index").setup({
daily_notes_folder = "~/Documents/daily-notes",
index_filename = "index.md",
index_title = "Daily Notes Index",
})
end
}Using vim-plug
Plug "bilyes/daily-notes-index.nvim"
lua << EOF
require("daily-notes-index").setup({
daily_notes_folder = "~/Documents/daily-notes",
index_filename = "index.md",
index_title = "Daily Notes Index",
})
EOFThe plugin can be configured through the setup() function:
require("daily-notes-index").setup({
daily_notes_folder = "~/Documents/daily-notes",
index_filename = "index.md",
index_title = "Daily Notes Index",
})| Option | Type | Default | Description |
|---|---|---|---|
daily_notes_folder |
string | "~/Documents/daily-notes" |
The folder where your daily notes are stored |
index_filename |
string | "index.md" |
The name of the index file to create/update |
index_title |
string | "Daily Notes Index" |
The title/header of the index file |
The plugin works automatically in the background. When you save a new daily note in the configured folder, it will:
- Detect if the saved file is a daily note based on date patterns in the filename
- Extract the date from the filename (supports formats like
2025-01-31.md) - Update the index file with a new entry in the format:
- [2025-01-31 - Friday](path/to/note)
- Organize entries by year and month in reverse chronological order
The plugin processes index updates asynchronously to prevent blocking the editor, ensuring smooth operation even with large collections of daily notes.
The plugin expects daily notes to have date patterns in their filenames. Supported formats include:
2025-01-31.md2025-01-31.md.md- Any filename containing a
YYYY-MM-DDpattern
The generated index file (index.md by default) will look like:
# Daily Notes Index
## 2025
### January
- [2025-01-31 - Friday](path/to/2025-01-31)
- [2025-01-30 - Thursday](path/to/2025-01-30)
- [2025-01-29 - Wednesday](path/to/2025-01-29)
### February
- [2025-02-01 - Saturday](path/to/2025-02-01)Manually update the index with a new daily note entry.
Check if a given note path corresponds to a daily note.
Get the path to the index file.
Get the current plugin configuration.
Configure the plugin with user options.
Opens the daily notes index file in the current buffer. If the index file doesn't exist, it will be created automatically.
:DailyNotesIndex openThe command handles the following scenarios:
- If the plugin is not configured, it shows an error message
- If the index file doesn't exist, it creates a new one with the configured title
- Opens the index file in the current window for immediate editing
Rebuilds the entire index file from scratch by scanning the daily notes folder. This command creates a comprehensive index that reflects the current state of all daily notes.
:DailyNotesIndex syncThe command performs the following actions:
- Scans the configured daily notes folder for all files
- Detects daily notes based on date patterns in filenames
- Validates date ranges (years 2000-2100, valid months/days)
- Rebuilds the entire index from scratch with all found daily notes
- Removes any entries from the index that no longer exist as files
- Shows a summary of how many notes were processed
This is useful when:
- You want to create an initial index for existing daily notes
- The index file has become corrupted or out of sync
- You've manually moved or renamed daily notes
- You want to clean up orphaned entries in the index
MIT License# daily-notes-index.nvim