Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nfrid/due.nvim
Neovim plugin for displaying due dates
https://github.com/nfrid/due.nvim
lua neovim neovim-plugin nvim nvim-plugin plugin
Last synced: 2 days ago
JSON representation
Neovim plugin for displaying due dates
- Host: GitHub
- URL: https://github.com/nfrid/due.nvim
- Owner: nfrid
- License: mit
- Created: 2021-06-14T21:44:44.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-04T22:17:16.000Z (about 1 year ago)
- Last Synced: 2024-08-01T21:24:42.207Z (3 months ago)
- Topics: lua, neovim, neovim-plugin, nvim, nvim-plugin, plugin
- Language: Lua
- Homepage:
- Size: 580 KB
- Stars: 113
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-neovim - nfrid/due.nvim - Displays due for a date string as a virtual text. (Note Taking / Cursorline)
README
# due.nvim
Simple plugin that provides you due for the date string.
![Example](img/ex1.png)
![Example with clock](img/ex2.png)
## Requirements
- Neovim 0.4.4+
## Installation
Using [packer.nvim](https://github.com/wbthomason/packer.nvim)
```lua
use {
'NFrid/due.nvim',
config = function()
require('due_nvim').setup {}
end
}
```You may use another plugin manager, [Plug](https://github.com/junegunn/vim-plug)
for example. In that case you will still need to initialize it with lua:```vim
lua << EOF
require('due_nvim').setup {}
EOF
```## Settings
Pass any of these settings to setup func to overwrite the defaults:
```lua
require('due_nvim').setup {
prescript = 'due: ', -- prescript to due data
prescript_hi = 'Comment', -- highlight group of it
due_hi = 'String', -- highlight group of the data itself
ft = '*.md', -- filename template to apply aucmds :)
today = 'TODAY', -- text for today's due
today_hi = 'Character', -- highlight group of today's due
overdue = 'OVERDUE', -- text for overdued
overdue_hi = 'Error', -- highlight group of overdued
date_hi = 'Conceal', -- highlight group of date stringpattern_start = '<', -- start for a date string pattern
pattern_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.html
date_pattern = '(%d%d)%-(%d%d)', -- m, d
datetime_pattern = date_pattern .. ' (%d+):(%d%d)', -- m, d, h, min
datetime12_pattern = datetime_pattern .. ' (%a%a)', -- m, d, h, min, am/pm
fulldate_pattern = '(%d%d%d%d)%-' .. date_pattern, -- y, m, d
fulldatetime_pattern = '(%d%d%d%d)%-' .. datetime_pattern, -- y, m, d, h, min
fulldatetime12_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_time and (use_seconds and 1000 or 60000) or 0,
-- selects the rate due clocks will update in
-- milliseconds. 0 or less disables ituse_clock_time = false, -- display also hours and minutes
use_clock_today = false, -- do it instead of TODAY
use_seconds = false, -- if use_clock_time == true, display seconds
-- as well
default_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
}
```## Functions
These are used to make it work..
```lua
require("due_nvim").draw(0) -- Draws it for a buffer (0 to current)
require("due_nvim").clean(0) -- Cleans the array from it
require("due_nvim").redraw(0) -- Cleans, then draws
require("due_nvim").async_update(0) -- Runs the async update function (needs update_rate > 0)
```