performance: avoid reloading config table #2360 (#2444)

* performance: avoid reloading config (#2360)

* performance: avoid reloading config

* Rm outdated info in readme

---------

Co-authored-by: Sidhanth Rathod <siduck@tutanota.com>

* update nvchad load_config result path

* update branch names

---------

Co-authored-by: georgejean <jeangeorge385@yahoo.fr>
This commit is contained in:
Sidhanth Rathod
2023-10-16 07:24:14 +05:30
committed by GitHub
co-authored by georgejean
parent ed18649e94
commit 5748536742
7 changed files with 12 additions and 14 deletions
+2 -5
View File
@@ -1,12 +1,9 @@
local opt = vim.opt
local g = vim.g
local config = require("core.utils").load_config()
-------------------------------------- globals -----------------------------------------
g.nvchad_theme = config.ui.theme
g.base46_cache = vim.fn.stdpath "data" .. "/nvchad/base46/"
g.toggle_theme_icon = ""
g.transparency = config.ui.transparency
-------------------------------------- options ------------------------------------------
opt.laststatus = 3 -- global statusline
@@ -83,11 +80,11 @@ autocmd("BufWritePost", {
local app_name = vim.env.NVIM_APPNAME and vim.env.NVIM_APPNAME or "nvim"
local module = string.gsub(fp, "^.*/" .. app_name .. "/lua/", ""):gsub("/", ".")
require("plenary.reload").reload_module "nvconfig"
require("plenary.reload").reload_module "base46"
require("plenary.reload").reload_module(module)
require("plenary.reload").reload_module "custom.chadrc"
config = require("core.utils").load_config()
local config = require "nvconfig"
vim.g.nvchad_theme = config.ui.theme
vim.g.transparency = config.ui.transparency