|
|
|
|
@ -158,14 +158,18 @@ M.toggle_theme = function()
|
|
|
|
|
|
|
|
|
|
config.ui.theme = (themes[1] == config.ui.theme and themes[2]) or themes[1]
|
|
|
|
|
|
|
|
|
|
require("nvchad.utils").change_key_val("theme", config.ui.theme)
|
|
|
|
|
local old_theme = dofile(vim.fn.stdpath "config" .. "/lua/custom/chadrc.lua").ui.theme
|
|
|
|
|
require("nvchad.utils").replace_word(old_theme, config.ui.theme)
|
|
|
|
|
M.load_all_highlights()
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
M.toggle_transparency = function()
|
|
|
|
|
config.ui.transparency = not config.ui.transparency
|
|
|
|
|
M.load_all_highlights()
|
|
|
|
|
require("nvchad.utils").change_key_val("transparency", config.ui.transparency)
|
|
|
|
|
|
|
|
|
|
local old_transparency_val = dofile(vim.fn.stdpath "config" .. "/lua/custom/chadrc.lua").ui.transparency
|
|
|
|
|
local new_transparency_val = "transparency = " .. tostring(config.ui.transparency)
|
|
|
|
|
require("nvchad.utils").replace_word("transparency = " .. tostring(old_transparency_val),new_transparency_val)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return M
|
|
|
|
|
|