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:
parent
80c8bf4243
commit
9961cc0113
9 changed files with 154 additions and 158 deletions
|
@ -57,7 +57,7 @@ capabilities.textDocument.completion.completionItem.resolveSupport = {
|
|||
},
|
||||
}
|
||||
|
||||
local servers = require("core.utils").load_config().plugins.lspconfig.servers
|
||||
local servers = require("core.utils").load_config().plugins.options.lspconfig.servers
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
nvim_lsp[lsp].setup {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
local M = {}
|
||||
|
||||
local config = require("core.utils").load_config()
|
||||
|
||||
M.autopairs = function()
|
||||
local present1, autopairs = pcall(require, "nvim-autopairs")
|
||||
local present2, autopairs_completion = pcall(require, "nvim-autopairs.completion.cmp")
|
||||
|
@ -25,7 +23,7 @@ M.autosave = function()
|
|||
end
|
||||
|
||||
autosave.setup {
|
||||
enabled = config.options.plugin.autosave, -- takes boolean value from chadrc.lua
|
||||
enabled = config.plugins.options.autosave, -- takes boolean value from init.lua
|
||||
execution_message = "autosaved at : " .. vim.fn.strftime "%H:%M:%S",
|
||||
events = { "InsertLeave", "TextChanged" },
|
||||
conditions = {
|
||||
|
@ -40,10 +38,10 @@ M.autosave = function()
|
|||
end
|
||||
|
||||
M.better_escape = function()
|
||||
local m = require("core.utils").load_config().mappings.plugin.better_escape.esc_insertmode
|
||||
local config = require("core.utils").load_config()
|
||||
require("better_escape").setup {
|
||||
mapping = m,
|
||||
timeout = config.options.plugin.esc_insertmode_timeout or 300,
|
||||
mapping = config.mappings.plugins.better_escape.esc_insertmode,
|
||||
timeout = config.plugins.options.esc_insertmode_timeout,
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ local icon_styles = {
|
|||
},
|
||||
}
|
||||
|
||||
local user_statusline_style = require("core.utils").load_config().ui.plugin.statusline.style
|
||||
local user_statusline_style = require("core.utils").load_config().plugins.options.statusline.style
|
||||
local statusline_style = icon_styles[user_statusline_style]
|
||||
|
||||
-- Initialize the components table
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue