From d0f8506fb6313a48a62f1f147b95e9919c191d9b Mon Sep 17 00:00:00 2001 From: Paulo Granthon Date: Tue, 9 Jan 2024 23:10:22 -0300 Subject: [PATCH] feat: add customization support through `config` module --- lua/hyper/config.lua | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lua/hyper/config.lua diff --git a/lua/hyper/config.lua b/lua/hyper/config.lua new file mode 100644 index 0000000..5c21753 --- /dev/null +++ b/lua/hyper/config.lua @@ -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