summaryrefslogtreecommitdiffstats
path: root/lua/core/misc.lua
diff options
context:
space:
mode:
authorSquibid <me@zacharyscheiman.com>2024-02-08 14:50:10 -0500
committerSquibid <me@zacharyscheiman.com>2024-02-08 19:50:24 -0500
commit6deb1b6a6bd72319db2845a53450a6039c613954 (patch)
tree4d62e3cf350301787e9465fdb189d08cf680f34f /lua/core/misc.lua
parent119127accf284ca1c3163226e070ba3412629993 (diff)
downloadnvim-6deb1b6a6bd72319db2845a53450a6039c613954.tar.gz
nvim-6deb1b6a6bd72319db2845a53450a6039c613954.tar.bz2
nvim-6deb1b6a6bd72319db2845a53450a6039c613954.zip
make color swapper change colorscheme in config
Diffstat (limited to '')
-rw-r--r--lua/core/misc.lua10
1 files changed, 10 insertions, 0 deletions
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 })