gruvbox-community / gruvbox

Retro groove color scheme for Vim - community maintained edition
MIT License
803 stars 62 forks source link

Darktheme loadng after vim 8.1 upgrade and migration to gruvbox-community #107

Closed tom0010 closed 2 years ago

tom0010 commented 5 years ago

I recently updated vim from 8.0 to 8.1 using brew in macOS, running 10.14.5. I then migrated to gruvbox-community and installed via Vundle:

:VundleClean
:VundleInstall
:VundleUpdate

However, now I only get a dark theme, seems something is not loading correctly, nothing has been changed in my .vimrc apart from: Plugin 'gruvbox-community/gruvbox' Is this expected or am I really missing something here? Screenshot here: http://tinypic.com/r/sl5gur/9

rbong commented 5 years ago

Gruvbox now automatically sets the theme based on your terminal's background using vim's built-in light/dark detection, which is likely what causes this.

Does running "set bg=light" in your vimrc work? Does "set t_RB=" in your vimrc work? This should disable background detection. What is the output of "echo v:termrbgresp" ? This should contain what your terminal reports as the background color.

If this does not help, could you please post a minimal vimrc?

tom0010 commented 5 years ago

Yeah I tried all of them they did not work. Where would you like me to echo? inside of vim? I tried this and it just removed the welcome screen when executing vim

Here is my .vimrc:

filetype off

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" Color
Plugin 'gruvbox-community/gruvbox'
Plugin 'altercation/vim-colors-solarized'

" Bundles for installation:
Plugin 'scrooloose/nerdtree'
" Plugin 'jlanzarotta/bufexplorer'
Plugin 'vim-airline/vim-airline'
Plugin 'Yggdroot/indentLine'
" Plugin 'tpope/vim-surround'
Plugin 'ctrlpvim/ctrlp.vim'
" Plugin 'tpope/vim-fugitive'
" Plugin 'elzr/vim-json'
Plugin 'tpope/vim-commentary'
" Plugin 'Valloric/YouCompleteMe'
Plugin 'aperezdc/vim-template'
Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'
" Plugin 'klen/python-mode'
" Plugin 'majutsushi/tagbar'
" Plugin 'jmcantrell/vim-virtualenv'

" Spell checking plugin !?!?

call vundle#end()

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => General configs
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" No compatibility with legacy VI
set nocompatible
" Enable filetype detaction
"filetype plugin indent off
" Disable mouse visual mode
set mouse-=a
" Set neovim true color
set termguicolors
" Syntax enabled
syntax enable
" Encoding
set encoding=utf-8
" Numerate lines
set number
" Highlight search
set hlsearch
" searches are case insensitive
set ignorecase
" searches incrementaly
set incsearch
"display command on lower right
set showcmd
" Tab Size = 4
set tabstop=4
" number of space characters inserted for indentation
set shiftwidth=4
" Use spaces, not tabs
set expandtab
" indent when moving to the next line while writing code
set autoindent
" show a visual line under the cursor's current line
set cursorline
" show the matching part of the pair for [] {} and ()
set showmatch

colorscheme gruvbox
" let g:solarized_termcolors=256
" colorscheme solarized
set background=dark

" Use the same symbols as TextMate for tabstops and EOLs
set listchars=tab:▸\ ,eol:¬
set list

" Invisible character colors 
highlight NonText guifg=#4a4a59
highlight SpecialKey guifg=#4a4a59

" don't remove quotes around strings on json files!
" let g:vim_json_syntax_conceal = 0

" IndentLine Settings
"let g:indentLine_enabled = 1
"let g:indentLine_char = '▸'

" Activate snipper
let g:UltiSnipsExpandTrigger="<C-Space>"

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Key bindings
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" H for previous buffer
map H :bp<CR>

" L for next buffer
map L :bn<CR>

" Open NerdTree
map <F2> :NERDTreeToggle<CR>

" Open Tagbar
nmap <F3> :TagbarToggle<CR>

" Run Python lintian
map <F4> :PymodeLint<CR>

" Open BufExplorer
map <F5> :BufExplorer<CR>

" Set filetype to ansible
map <F6> :tab sb<CR>

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Misc commands
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" Format JSON files (entire file)
com! FormatJSON %!python -m json.tool

" Allow saving of files as sudo
cmap w!! w !sudo tee > /dev/null %

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Airline setup
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

set laststatus=2
set fillchars+=stl:\ ,stlnc:\
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#show_tab_nr = 1

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Ansible syntax
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

let g:ansible_attribute_highlight = "ob"
let g:ansible_name_highlight = 'd'
let g:ansible_extra_keywords_highlight = 1

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Python setup
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

" Force the use of python (avoids problems when inside virtualenvs)
let g:python_host_prog='/usr/bin/python'
let g:python3_host_prog='/usr/bin/python3'

"Force jedi to use python 3
let g:jedi#force_py_version = 3

" Pymode Settings
let g:pymode_rope = 1
let g:pymode_rope_complete_on_dot = 0
let g:pymode_rope_completion = 0
let g:pymode_rope_goto_definition_bind = '<C-c>g'
let g:pymode_options_max_line_length = 120
let g:pymode_breakpoint_cmd = 'from pudb import set_trace; set_trace() ### XXX'

" Python docstring formatting
let g:ultisnips_python_style = "google"

" Python autocommands
augroup pythonGroup
  autocmd!
  autocmd FileType python highlight Excess ctermbg=DarkGrey guibg=Black
  autocmd FileType python match Excess /\%120v.*/
  autocmd FileType python set nowrap
  autocmd FileType python map <F11> :!clear; make test<CR>
augroup END

I did try commenting out set background=dark that did slightly help, some words are highlighted in white now, but not all.

Thanks for looking.

rbong commented 5 years ago

Sorry for the confusion, yes you should echo from inside vim and not your vimrc. So is the problem that it's stuck in the dark theme or are some colors just not loading properly?

I'm on my phone right now but I will try to recreate later. If I can't recreate it, I may need just a minimal vimrc cut down to just the lines needed to recreate the problem on your side so I can look into each line.

tom0010 commented 5 years ago

Yeah I did that inside of vim. And yes looks like I am stuck inside of dark theme, maybe this is not related to gruvbox-community exactly, however, still appreciate the help.

rbong commented 5 years ago

I am very sorry for the wait. I cannot recreate inside of vim. If @t1hom7as or anyone else with this problem can let me know the value of :echo v:termrbgresp inside of Vim, your shell, and your platform, it would be much appreciated.

tom0010 commented 5 years ago

@rbong I did execute the command when opening vim, but nothing happened. Is there anything else I could try?

tom0010 commented 2 years ago

Funny that I am rekindling this, after leaving this for such a long time, I was trying to do the same thing once again. @rbong here is the output:

^[]11;rgb:0000/0000/0000^G

Hopefully that means something?

tom0010 commented 2 years ago

Turns out this was the issue inside .vimrc:

set termguicolors