diff --git a/lua/core/bootstrap.lua b/lua/core/bootstrap.lua index 2f435d9..865f3b4 100644 --- a/lua/core/bootstrap.lua +++ b/lua/core/bootstrap.lua @@ -50,11 +50,13 @@ M.gen_chadrc_template = function() local path = vim.fn.stdpath "config" .. "/lua/custom/" local input = vim.fn.input "Do you want to install example custom config? (y/N) : " + -- clone example_config repo if input == "y" then M.echo "cloning example custom config repo ..." vim.fn.system { "git", "clone", "--depth", "1", "https://github.com/NvChad/example_config", path } vim.fn.delete(path .. ".git", "rf") else + -- use very minimal chadrc vim.fn.mkdir(path, "p") local file = io.open(path .. "chadrc.lua", "w") diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index f09fad0..0f5ce56 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -18,6 +18,7 @@ M.ui = { theme_toggle = { "onedark", "one_light" }, theme = "onedark", -- default theme transparency = false, + lsp_semantic_tokens = false, -- needs nvim v0.9, just adds highlight groups for lsp semantic tokens -- cmp themeing cmp = { diff --git a/lua/core/utils.lua b/lua/core/utils.lua index e95078c..4c44dc6 100644 --- a/lua/core/utils.lua +++ b/lua/core/utils.lua @@ -52,37 +52,39 @@ M.remove_disabled_keys = function(chadrc_mappings, default_mappings) end M.load_mappings = function(section, mapping_opt) - local function set_section_map(section_values) - if section_values.plugin then - return - end + vim.schedule(function() + local function set_section_map(section_values) + if section_values.plugin then + return + end - section_values.plugin = nil + section_values.plugin = nil - for mode, mode_values in pairs(section_values) do - local default_opts = merge_tb("force", { mode = mode }, mapping_opt or {}) - for keybind, mapping_info in pairs(mode_values) do - -- merge default + user opts - local opts = merge_tb("force", default_opts, mapping_info.opts or {}) + for mode, mode_values in pairs(section_values) do + local default_opts = merge_tb("force", { mode = mode }, mapping_opt or {}) + for keybind, mapping_info in pairs(mode_values) do + -- merge default + user opts + local opts = merge_tb("force", default_opts, mapping_info.opts or {}) - mapping_info.opts, opts.mode = nil, nil - opts.desc = mapping_info[2] + mapping_info.opts, opts.mode = nil, nil + opts.desc = mapping_info[2] - vim.keymap.set(mode, keybind, mapping_info[1], opts) + vim.keymap.set(mode, keybind, mapping_info[1], opts) + end end end - end - local mappings = require("core.utils").load_config().mappings + local mappings = require("core.utils").load_config().mappings - if type(section) == "string" then - mappings[section]["plugin"] = nil - mappings = { mappings[section] } - end + if type(section) == "string" then + mappings[section]["plugin"] = nil + mappings = { mappings[section] } + end - for _, sect in pairs(mappings) do - set_section_map(sect) - end + for _, sect in pairs(mappings) do + set_section_map(sect) + end + end) end M.lazy_load = function(plugin)