mirror of
https://github.com/paulo-granthon/hyper.nvim
synced 2025-05-16 06:58:54 +00:00
feat: add customization support through config
module
This commit is contained in:
parent
39e3e0d626
commit
d0f8506fb6
32
lua/hyper/config.lua
Normal file
32
lua/hyper/config.lua
Normal file
@ -0,0 +1,32 @@
|
||||
local M = {}
|
||||
|
||||
local ok, error = pcall(require, 'hyper.error')
|
||||
if not ok then
|
||||
return vim.api.nvim_err_writeln(require('hyper.const.error').import)
|
||||
end
|
||||
|
||||
---@type Config
|
||||
local defaults = {
|
||||
colors = 'hyper',
|
||||
highlights = 'hyper',
|
||||
|
||||
color_overrides = {},
|
||||
highlights_overrides = {},
|
||||
}
|
||||
|
||||
---@type Config
|
||||
M.options = {}
|
||||
|
||||
---@param options Config|nil
|
||||
function M.setup(options)
|
||||
M.options = vim.tbl_deep_extend("force", {}, defaults, options or {})
|
||||
end
|
||||
|
||||
---@param options Config|nil
|
||||
function M.extend(options)
|
||||
M.options = vim.tbl_deep_extend("force", {}, M.options or defaults, options or {})
|
||||
end
|
||||
|
||||
M.setup()
|
||||
|
||||
return M
|
Loading…
Reference in New Issue
Block a user