From 6deb1b6a6bd72319db2845a53450a6039c613954 Mon Sep 17 00:00:00 2001 From: Squibid Date: Thu, 8 Feb 2024 14:50:10 -0500 Subject: make color swapper change colorscheme in config --- lua/core/misc.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lua/core/misc.lua') diff --git a/lua/core/misc.lua b/lua/core/misc.lua index 6f69e81..1f6d427 100644 --- a/lua/core/misc.lua +++ b/lua/core/misc.lua @@ -11,6 +11,16 @@ function M.colorscheme(name) end end +function M.replaceword(old, new) + local conf = vim.fn.stdpath("config").."/lua/conf/".."opts.lua" + local f = io.open(conf, "r") + local new_content = f:read("*all"):gsub(old, new) + + f = io.open(conf, "w") + f:write(new_content) + f:close() +end + function M.include(fn) if not pcall(require, fn) then vim.notify('Could not find "'..fn, vim.log.levels.WARN..'"', { title = M.appid }) -- cgit v1.2.1