diff --git a/.config/nvim/lua/blake/other.lua b/.config/nvim/lua/blake/other.lua index d56db9e..b78b1b5 100644 --- a/.config/nvim/lua/blake/other.lua +++ b/.config/nvim/lua/blake/other.lua @@ -97,24 +97,21 @@ M.gitsigns = function() keymaps = { -- Default keymap options noremap = true, - ['n ]c'] = { expr = true, "&diff ? ']c' : 'lua require\"gitsigns.actions\".next_hunk()'"}, ['n [c'] = { expr = true, "&diff ? '[c' : 'lua require\"gitsigns.actions\".prev_hunk()'"}, - + -- hunk binds ['n hs'] = 'lua require"gitsigns".stage_hunk()', + ['v hs'] = 'lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})', ['n hu'] = 'lua require"gitsigns".undo_stage_hunk()', ['n hr'] = 'lua require"gitsigns".reset_hunk()', - - ['v hs'] = 'lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})', ['v hr'] = 'lua require"gitsigns".reset_hunk({vim.fn.line("."), vim.fn.line("v")})', - ['n hp'] = 'lua require"gitsigns".preview_hunk()', - ['n hb'] = 'lua require"gitsigns".blame_line(true)', - + -- buffer binds ['n hS'] = 'lua require"gitsigns".stage_buffer()', ['n hR'] = 'lua require"gitsigns".reset_buffer()', ['n hU'] = 'lua require"gitsigns".reset_buffer_index()', - + -- misc. + ['n hb'] = 'lua require"gitsigns".blame_line(true)', -- Text objects ['o ih'] = 'lua require"gitsigns.actions".select_hunk()', ['x ih'] = 'lua require"gitsigns.actions".select_hunk()' @@ -189,6 +186,26 @@ M.autosession = function() vim.cmd 'command! SessionRestore RestoreSession' end -- <<< +-- due: TODAY >>> +M.due = function() + 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 = '*.sh', -- 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 string + pattern_start = '<', -- start for a date string pattern + pattern_end = '>', -- end for a date string pattern + use_clock_time = false, -- allow due.nvim to calculate hours, minutes, and seconds + 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 + } +end -- <<< + return M -- vim:fdm=marker:fmr=>>>,<<<:expandtab:tabstop=3:sw=3 diff --git a/.config/nvim/lua/blake/plugins.lua b/.config/nvim/lua/blake/plugins.lua index 6b52cc9..09e9a27 100644 --- a/.config/nvim/lua/blake/plugins.lua +++ b/.config/nvim/lua/blake/plugins.lua @@ -183,6 +183,12 @@ return require('packer').startup(function() use { -- tpope: Repeatability for various tpope plugins 'tpope/vim-repeat', } + use { -- displays 'due: 2d 5h 3m' if there is a date (<12-25>) on the line + 'NFrid/due.nvim', + config = function() + require('blake.other').due() + end + } end)