-
-
Notifications
You must be signed in to change notification settings - Fork 207
Open
Description
Some color schemes don't support toggling light/dark background and trying to do it results in a mangled color scheme.
I fixed this by overriding the yob
map, but I was wondering if there is interest to merge this here.
This is my function (I'm not good at vimscript so let me know any feedback):
function! s:ToggleBackground() abort
let oldcolors = g:colors_name
if &background == 'light'
set background=dark
else
set background=light
endif
if !exists("g:colors_name") || oldcolors != g:colors_name
execute 'colorscheme ' . oldcolors
redraw | echo 'Color scheme ' . oldcolors . ' does not support changing the background'
endif
endfunction
if this is interesting for the project I can create a pull request (or just take the function from here, I don't mind).
To integrate properly it would also have to support the enable/disable commands too. I don't use those so I didn't do it here but I can add it.
Metadata
Metadata
Assignees
Labels
No labels