From 98bc388c4acc64e587682003081c333dbdcdd396 Mon Sep 17 00:00:00 2001 From: Alex Selimov Date: Mon, 11 Nov 2024 21:59:14 -0500 Subject: [PATCH] Add toggle to keep light mode based on terminal colorscheme --- init.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/init.lua b/init.lua index 889affa..6635e21 100644 --- a/init.lua +++ b/init.lua @@ -893,3 +893,12 @@ vim.api.nvim_create_user_command("FormatEnable", function() end, { desc = "Re-enable autoformat-on-save", }) + +function file_exists(name) + local f = io.open(name, "r") + return f ~= nil and io.close(f) +end + +if file_exists("/home/aselimov/.config/.stlight") then + vim.opt.background = "light" +end