note2cal
is a Neovim plugin designed to quickly create events directly from markdown files. Making for a great companion to whatever note taking flow you use.
With one keymap (or one command), a line like Do something @ 3pm-4pm
or Do something @ 2025-01-20 3pm-4pm
will be converted to an accordingly named event in your calendar at that specified time. See more ways to specifying the time in the Supported Formats section.
Contributions are welcome!
YYYY-MM-DD
We support various time formats, including 24-hour, AM/PM, military time, and compact formats. The following table summarizes it, you can also see the spec for more examples:
Example Input | Parsed into (formatted here in this table as 24-hour HH:MM-HH:MM for clarity) |
---|---|
6-7 |
06:00-07:00 |
3-430 |
03:00-04:30 |
3p-4p |
15:00-16:00 |
3pm-4pm |
15:00-16:00 |
12pm-1pm |
12:00-13:00 |
12am-1am |
00:00-01:00 |
0500-1730 |
05:00-17:30 |
3:15-4:30 |
03:15-04:30 |
315a-430a |
03:15-04:30 |
315am-430am |
03:15-04:30 |
3:15am-4:30am |
03:15-04:30 |
Example using Lazy (the values listed are the default ones):
{
'lfilho/note2cal.nvim',
config = function()
require("note2cal").setup({
debug = false, -- if true, prints a debug message an return early (won't schedule events)
calendar_name = "Work", -- the name of the calendar as it appear on Calendar.app
highlights = {
at_symbol = "WarningMsg", -- the highlight group for the "@" symbol
at_text = "Number", -- the highlight group for the date-time part
},
keymaps = {
normal = "<Leader>se", -- mnemonic: Schedule Event
visual = "<Leader>se", -- mnemonic: Schedule Event
},
})
end,
ft = "markdown",
},
It works in normal mode and visual mode (single or multiple lines).
Just call it with the keymap you configured above or invoke the command :Note2cal
in the desired lines.
[!NOTE]
- If no date is provided, the script assumes today's date.
- Even if the Calendar.app is not open, the script will open it in the background in order to schedule the event.
Contributions are welcome!
brew install lua luarocks && luarocks install busted
)./scripts/test.sh
@
pattern configurableYYYY-MM-DD
None that I know of, feel free to send me a PR to list it here!
This plugin would be a great addition to note taking or task management plugins, such as: