feat: Add user customization and refactor for readability

- Add user customization via automatically detected user.lua file
- Reorganize config options into separate files
- Reorganize plugin loaders into separate files
This commit is contained in:
2024-10-04 10:11:16 -04:00
parent c44e4985d2
commit 65917d380a
10 changed files with 286 additions and 167 deletions
+34
View File
@@ -0,0 +1,34 @@
-- ╭─────────────────────────────────────────────────────────╮
-- │ CONFIG │
-- ╰─────────────────────────────────────────────────────────╯
local opts = {}
-- Function to merge tables into opts
local function merge_into_opts(mod)
for k, v in pairs(require("config." .. mod)) do
opts[k] = v
end
end
-- List of config modules to merge
local modules = {
"colors",
"font",
"keys",
"window",
"platform",
}
-- If USERCONFIG is true, merge userconfig
if USERCONFIG then
merge_into_opts("user")
end
-- Merge all modules into opts
for _, mod in ipairs(modules) do
merge_into_opts(mod)
end
-- Return config options
return opts