morhetz / gruvbox

Retro groove color scheme for Vim
13.59k stars 1.1k forks source link

Swaping between light and dark background #321

Open SolidTux opened 4 years ago

SolidTux commented 4 years ago

With lucius I had keybindings to switch between dark and light background:

nnoremap <Leader>bd :set background=dark<CR>
nnoremap <Leader>bl :set background=light<CR>

Similar commands only work partly with gruvbox as not everything seems to be changed back (e.g. the cursor)

Starting with dark

dark1

Switching to light works

light

But switching back to dark doesn't complete work

dark2

But switching again to light works, only the dark one seems to be somewhat broken here.

polyzen commented 4 years ago

You could try https://gitlab.com/polyzen/togglebg.vim which was taken from https://github.com/altercation/vim-colors-solarized. Also mirrored here: https://github.com/polyzen/togglebg.vim

SolidTux commented 4 years ago

Sadly, this leads to the same result. And I also just tested what happens when I start with the light background. In that case it's the light background which is broken. So it's always the starting theme that doesn't work when switching back and forth. I'll try again with a minimal configuration and see if that can reproduce it.

SolidTux commented 4 years ago

It does appear with the following configuration

call plug#begin('~/.local/share/nvim/plugged')
Plug 'morhetz/gruvbox'
call plug#end()

set background=dark
colorscheme gruvbox
nnoremap <Leader>bd :set background=dark<CR>
nnoremap <Leader>bl :set background=light<CR>

but only with nvim-gtk, so I'm not sure, where the problem lies as lucius works fine here :man_shrugging: