feat: rename
This commit is contained in:
parent
47a5c7a5e5
commit
53ab1cc000
21 changed files with 191 additions and 191 deletions
42
lua/pending/config.lua
Normal file
42
lua/pending/config.lua
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
---@class pending.GcalConfig
|
||||
---@field calendar? string
|
||||
---@field credentials_path? string
|
||||
|
||||
---@class pending.Config
|
||||
---@field data_path string
|
||||
---@field default_view 'category'|'priority'
|
||||
---@field default_category string
|
||||
---@field date_format string
|
||||
---@field date_syntax string
|
||||
---@field gcal? task.GcalConfig
|
||||
|
||||
---@class pending.config
|
||||
local M = {}
|
||||
|
||||
---@type pending.Config
|
||||
local defaults = {
|
||||
data_path = vim.fn.stdpath('data') .. '/pending/tasks.json',
|
||||
default_view = 'category',
|
||||
default_category = 'Inbox',
|
||||
date_format = '%b %d',
|
||||
date_syntax = 'due',
|
||||
}
|
||||
|
||||
---@type pending.Config?
|
||||
local _resolved = nil
|
||||
|
||||
---@return pending.Config
|
||||
function M.get()
|
||||
if _resolved then
|
||||
return _resolved
|
||||
end
|
||||
local user = vim.g.pending or {}
|
||||
_resolved = vim.tbl_deep_extend('force', defaults, user)
|
||||
return _resolved
|
||||
end
|
||||
|
||||
function M.reset()
|
||||
_resolved = nil
|
||||
end
|
||||
|
||||
return M
|
||||
Loading…
Add table
Add a link
Reference in a new issue