Simple plugin that provides you due for the date string.
- Neovim 0.4.4+
Using packer.nvim
use {
'NFrid/due.nvim',
config=function()
require('due_nvim').setup {}
end
}You may use another plugin manager, Plug for example. In that case you will still need to initialize it with lua:
lua << EOF
require('due_nvim').setup {}
EOFPass any of these settings to setup func to overwrite the defaults:
require('due_nvim').setup {
prescript='due: ', -- prescript to due dataprescript_hi='Comment', -- highlight group of itdue_hi='String', -- highlight group of the data itselfft='*.md', -- filename template to apply aucmds :)today='TODAY', -- text for today's duetoday_hi='Character', -- highlight group of today's dueoverdue='OVERDUE', -- text for overduedoverdue_hi='Error', -- highlight group of overdueddate_hi='Conceal', -- highlight group of date stringpattern_start='<', -- start for a date string patternpattern_end='>', -- end for a date string pattern-- lua patterns: in brackets are 'groups of data', their order is described-- accordingly. More about lua patterns: https://www.lua.org/pil/20.2.htmldate_pattern='(%d%d)%-(%d%d)', -- m, ddatetime_pattern=date_pattern..' (%d+):(%d%d)', -- m, d, h, mindatetime12_pattern=datetime_pattern..' (%a%a)', -- m, d, h, min, am/pmfulldate_pattern='(%d%d%d%d)%-' ..date_pattern, -- y, m, dfulldatetime_pattern='(%d%d%d%d)%-' ..datetime_pattern, -- y, m, d, h, minfulldatetime12_pattern=fulldatetime_pattern..' (%a%a)', -- y, m, d, h, min, am/pm-- idk how to allow to define the order by config yet,-- but you can help me figure it out...regex_hi="\\d*-*\\d\\+-\\d\\+\\( \\d*:\\d*\\( \\a\\a\\)\\?\\)\\?",
-- vim regex for highlighting, notice double-- backslashes cuz lua strings escapingupdate_rate=use_clock_timeand (use_secondsand1000or60000) or0,
-- selects the rate due clocks will update in-- milliseconds. 0 or less disables ituse_clock_time=false, -- display also hours and minutesuse_clock_today=false, -- do it instead of TODAYuse_seconds=false, -- if use_clock_time == true, display seconds-- as welldefault_due_time="midnight" -- if use_clock_time == true, calculate time-- until option on specified date. Accepts-- "midnight", for 23:59:59, or noon, for-- 12:00:00
}These are used to make it work..
require("due_nvim").draw(0) -- Draws it for a buffer (0 to current)require("due_nvim").clean(0) -- Cleans the array from itrequire("due_nvim").redraw(0) -- Cleans, then drawsrequire("due_nvim").async_update(0) -- Runs the async update function (needs update_rate > 0)
