2023-03-26 16:03:06 +02:00
|
|
|
---@alias ItalicType
|
|
|
|
---|"strings"
|
|
|
|
---|"comments"
|
|
|
|
---|"operators"
|
|
|
|
---|"folds"
|
|
|
|
|
2023-03-30 03:50:44 +02:00
|
|
|
---@alias InvertType
|
|
|
|
---|"signs"
|
|
|
|
---|"tabline"
|
2023-04-17 20:03:33 +02:00
|
|
|
---|"visual"
|
2023-03-30 03:50:44 +02:00
|
|
|
|
2023-03-26 06:12:43 +02:00
|
|
|
---@class GruberDarkerOpts
|
2023-03-13 12:31:31 +01:00
|
|
|
---@field bold boolean
|
2023-03-30 03:50:44 +02:00
|
|
|
---@field invert table<InvertType, boolean>
|
2023-03-26 16:03:06 +02:00
|
|
|
---@field italic table<ItalicType, boolean>
|
|
|
|
---@field undercurl boolean
|
2023-03-13 12:31:31 +01:00
|
|
|
---@field underline boolean
|
2023-01-23 05:48:37 +01:00
|
|
|
|
2023-03-26 06:12:43 +02:00
|
|
|
---@type GruberDarkerOpts
|
|
|
|
local DEFAULTS = {
|
|
|
|
bold = true,
|
2023-03-30 03:50:44 +02:00
|
|
|
invert = {
|
2023-03-30 06:13:32 +02:00
|
|
|
signs = false,
|
2023-03-30 03:50:44 +02:00
|
|
|
tabline = false,
|
2023-04-17 20:03:33 +02:00
|
|
|
visual = false,
|
2023-03-30 03:50:44 +02:00
|
|
|
},
|
2023-03-26 16:03:06 +02:00
|
|
|
italic = {
|
2023-03-26 16:04:41 +02:00
|
|
|
strings = true,
|
|
|
|
comments = true,
|
|
|
|
operators = false,
|
|
|
|
folds = true,
|
|
|
|
},
|
2023-03-30 03:50:44 +02:00
|
|
|
undercurl = true,
|
2023-03-26 06:12:43 +02:00
|
|
|
underline = true,
|
2023-01-23 05:48:37 +01:00
|
|
|
}
|
|
|
|
|
2023-03-26 06:12:43 +02:00
|
|
|
---@class ConfigMgr
|
|
|
|
---@field private resolved_opts GruberDarkerOpts
|
|
|
|
local ConfigMgr = {}
|
|
|
|
ConfigMgr.__index = ConfigMgr
|
|
|
|
|
|
|
|
---@type ConfigMgr|nil
|
|
|
|
local instance = nil
|
|
|
|
|
2023-01-23 05:48:37 +01:00
|
|
|
---Get GruberDarker user preferences
|
2023-03-26 06:12:43 +02:00
|
|
|
---@return GruberDarkerOpts
|
2023-01-23 05:48:37 +01:00
|
|
|
---@nodiscard
|
2023-03-26 06:12:43 +02:00
|
|
|
function ConfigMgr.get_opts()
|
2023-03-26 16:04:41 +02:00
|
|
|
if instance ~= nil then
|
|
|
|
return instance.resolved_opts
|
|
|
|
end
|
2023-03-26 06:12:43 +02:00
|
|
|
|
2023-03-26 16:04:41 +02:00
|
|
|
return DEFAULTS
|
2023-01-23 05:48:37 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
---Set GruberDarker colorscheme options
|
2023-03-26 06:12:43 +02:00
|
|
|
---@param opts? GruberDarkerOpts
|
|
|
|
function ConfigMgr.setup(opts)
|
|
|
|
if instance ~= nil then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
instance = setmetatable({
|
|
|
|
resolved_opts = vim.tbl_deep_extend("force", DEFAULTS, opts or {}),
|
|
|
|
}, ConfigMgr)
|
2023-01-23 05:48:37 +01:00
|
|
|
end
|
|
|
|
|
2023-03-26 06:12:43 +02:00
|
|
|
return ConfigMgr
|