Simplify light mode toggle with a switch
This commit is contained in:
parent
c34dee4d4e
commit
84e339864c
2 changed files with 7 additions and 5 deletions
3
init.lua
3
init.lua
|
@ -1,3 +1,6 @@
|
||||||
|
-- set to true for light mode
|
||||||
|
vim.g.light_mode = true
|
||||||
|
|
||||||
-- Neovim configuration
|
-- Neovim configuration
|
||||||
-- Modularized structure for better organization
|
-- Modularized structure for better organization
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,10 @@ return {
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
dependencies = "rktjmp/lush.nvim",
|
dependencies = "rktjmp/lush.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
vim.cmd.colorscheme("zenwritten")
|
if vim.g.light_mode then
|
||||||
local term_bg = os.getenv("TERM_BACKGROUND")
|
vim.o.background = "light"
|
||||||
if term_bg == "light" then
|
|
||||||
vim.opt.background = "light"
|
|
||||||
end
|
end
|
||||||
|
vim.cmd.colorscheme("zenbones")
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue