Closed erf closed 1 year ago
I just use default-16.lua theme and that uses my terminal colors which are gruvbox modified.
Oh, I meant via the Lua api
I think that the way this is done by vis-seapeak might be what you are looking for?
I was more looking for a way to get the current background color or an event when when the theme was set, with the theme colors so i could get it from there.
.. but what vis-seapeak
has done, gave me an idea, of how to add themes as plugins !
That is by adding a separate init.lua
file and calling set_theme
on the INIT
event, you could easily add themes as plugins, e.g. using my vis-plug - shameless plug ;)
My way of solving this is something like the following:
.visrc:
background = 'dark'
vis:command_register("tbg", function()
if background == 'light' then
background = 'dark'
else if background == 'dark' then
background = 'light'
end
end)
vis:command('map! normal <F12> :tbg<Enter>:set\\ theme\\ gruvbox<Enter>')
And I modified the gruvbox theme to use the background
variable.
local mode = background
Is there a way to get the background color of the current theme?
Also an event for when switching themes would be nice.