2025-02-09 01:42:00
github.com
An nvim plugin to enable creating periodic notes for journals and planning.
Inspired by the Obsidian feature of the same name and
Journal.nvim.
I use this as part of my personal
Zettelkasten.
-- install from local repo
-- this is just an example; you can just as well use empty opts {}
{
dir = "~/daily-notes.nvim",
opts = {
writing = {
root = "~/zettelkasten/daily-notes"
}
}
}
-- install from github repo
{ "fdavies93/daily-notes.nvim", opts = {} }
Note that this plugin is only tested on my personal Arch Linux for now. It
should work on other UNIX systems (i.e. WSL, MacOS, BSD), but this isn’t
guaranteed. Windows probably won’t work due to differences in file and date
handling.
The most important option is writing.root
. This controls where
daily-notes.nvim tries to put new notes and open existing notes. This should
integrate with existing setups if you set the writing.day
and other options to
match your current filename formats.
It’s also worth setting writing.day.template
to your preferred format for that
type of note, e.g:
{
writing = {
day = {
template = "# %A, %B %d %Y\n\n## Notes\n\n## Tasks\n\n## Timebox"
}
}
}
If your locale is not English you will need to set parsing.week_starts
to be a
string in your locale’s language. This is because locale strings are used
internally for parsing to avoid mixing calls to os.time
with baked-in strings.
If you prefer weekly notes to daily ones, you can change parsing.default
to be
this week
.
For a full list of config options,
see the default config here.
Setup your configuration so the directories and templates follow your preferred
date format.
:DailyNote day +1
:DailyNote next week
:DailyNote tuesday
:FuzzyTime 2025
daily-notes.nvim exports :DailyNote
and :FuzzyTime
user commands.
:DailyNote
creates a new note or opens a note if one already exists.
:FuzzyTime
gives time information for the given input and can be used as a way
to do a ‘dry run’ of :DailyNote
or to play with the date parser.
daily-notes.nvim implements a
recursive descent parser
to resolve dates in English into timestamps and create files.
Dates are parsed in the following order:
- Timestamps
- Unambiguous semantic dates (e.g. ‘today’)
- Ambiguous semantic dates (e.g. ‘this Tuesday’)
The different algorithms for resolving ambiguous dates can be selected in the
config at parsing.resolve_strategy
.
-- PERIOD is ("day" | "week" | "month" | "year") ~ "s"?
-- Unambiguous semantic dates
today
tomorrow
yesterday
YEAR[,] week NUM
-- if year isn't defined, we just use the current year
week NUM[,] [YEAR]
[+/-]NUM PERIOD
PERIOD [+/-]NUM
PERIOD -- the same as 'this PERIOD'
this PERIOD
next PERIOD
(last | previous | prev) PERIOD
in [+/-]NUM PERIOD
[+/-]NUM PERIOD ago
-- Ambiguous semantic dates
-- WEEKDAY is generated from the locale names for the weekdays, e.g. "tuesday"
-- and their 3-letter prefixes e.g. "tue"
-- the meaning of this / next / last is determined by config
WEEKDAY
this WEEKDAY
next WEEKDAY
(last | previous | prev) WEEKDAY
-- these always use the current week +/- weeks
[+/-]NUM WEEKDAY
WEEKDAY [+/-]NUM
-- MONTH is generated from the locale names for the months, e.g. "january"
-- and their 3-letter prefixes e.g. "jan"
-- the meaning of this / next / last is determined by config
MONTH
this MONTH
next MONTH
(last | previous | prev) MONTH
DAY MONTH
MONTH DAY
[+/-]NUM MONTH
MONTH [+/-]NUM
For the details of date parsing
see the fuzzy time module.
For all timestamp formats see default config.
We use the default strftime for rendering dates, but %W
(week number) and %w
(numerical day of week) are replaced by bespoke logic so that alternate week
starts are possible.
I prefer plugins that do one job, rather than all-in-one tools.
Keep your files stored safely and securely with the SanDisk 2TB Extreme Portable SSD. With over 69,505 ratings and an impressive 4.6 out of 5 stars, this product has been purchased over 8K+ times in the past month. At only $129.99, this Amazon’s Choice product is a must-have for secure file storage.
Help keep private content private with the included password protection featuring 256-bit AES hardware encryption. Order now for just $129.99 on Amazon!
Help Power Techcratic’s Future – Scan To Support
If Techcratic’s content and insights have helped you, consider giving back by supporting the platform with crypto. Every contribution makes a difference, whether it’s for high-quality content, server maintenance, or future updates. Techcratic is constantly evolving, and your support helps drive that progress.
As a solo operator who wears all the hats, creating content, managing the tech, and running the site, your support allows me to stay focused on delivering valuable resources. Your support keeps everything running smoothly and enables me to continue creating the content you love. I’m deeply grateful for your support, it truly means the world to me! Thank you!
BITCOIN bc1qlszw7elx2qahjwvaryh0tkgg8y68enw30gpvge Scan the QR code with your crypto wallet app |
DOGECOIN D64GwvvYQxFXYyan3oQCrmWfidf6T3JpBA Scan the QR code with your crypto wallet app |
ETHEREUM 0xe9BC980DF3d985730dA827996B43E4A62CCBAA7a Scan the QR code with your crypto wallet app |
Please read the Privacy and Security Disclaimer on how Techcratic handles your support.
Disclaimer: As an Amazon Associate, Techcratic may earn from qualifying purchases.