morhetz / gruvbox

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

Dark not working #408

Open allopislozano opened 2 years ago

allopislozano commented 2 years ago

Hello!

I have this code in my after plugins script: .vim/after/plugin/setColors.vim:

colorscheme gruvbox
set bg=dark

This works perfectly in console mode, but in gui mode I do not get the dark background, in fact set bg? returns light

What can be happening?

christianrickert commented 2 years ago

Try this code snippet:

autocmd vimenter * ++nested colorscheme gruvbox
set termguicolors
set background=dark

From the VIM documentation about vimenter:

After doing all the startup stuff, including loading .vimrc files,
executing the "-c cmd" arguments, creating all windows and
loading the buffers in them.

Another important information is the client you're using as well as the operating system.

allopislozano commented 2 years ago

Thanks for the idea @christianrickert , this works: autocmd VimEnter * set bg=dark

That's a great improvement already, however I'd like to keep the issue open in case this can be fixed without the need to call that command each time that a file is open

This is my environment. My OS is red hat linux image

christianrickert commented 2 years ago

I'm glad it worked (a bit) @allopislozano