refactor: clean & re-organise default_config + chadrc

this completely overhauls the design of the two configuration files,
aiming to move options & various tables into a more sensible table structure

BREAKING CHANGE: this will break any user modificiations to the current
config
This commit is contained in:
Galen Rowell 2021-09-19 18:11:28 +10:00 committed by siduck76
parent 80c8bf4243
commit 9961cc0113
9 changed files with 154 additions and 158 deletions

View file

@ -7,16 +7,14 @@ end
local use = packer.use
return packer.startup(function()
local plugin_status = require("core.utils").load_config().plugin_status
-- local plugin_overrides = require("core.utils").load_config().custom.plugin_overrides
local plugin_status = require("core.utils").load_config().plugins.plugin_status
-- FUNCTION: override_req, use `chadrc` plugin config override if present
-- name = name inside `default_config` / `chadrc`
-- default_req = run this if 'name' does not exist in `default_config` / `chadrc`
-- if override or default_req start with `(`, then strip that and assume override calls a function, not a whole file
local override_req = function(name, default_req)
local override = require("core.utils").load_config().custom.default_plugin_overrides[name]
local override = require("core.utils").load_config().plugins.default_plugin_config_replace[name]
local result
if override == nil then
@ -166,7 +164,7 @@ return packer.startup(function()
"Pocco81/AutoSave.nvim",
config = override_req("autosave", "(plugins.configs.others).autosave()"),
cond = function()
return require("core.utils").load_config().options.plugin.autosave == true
return require("core.utils").load_config().plugins.options.autosave == true
end,
}