Install the gruvbox colorscheme and use it in Neovim and GVim

gruvbox is updated more often than Inkpot and works better in modern Vim - however, the 'termguicolors' option doesn't quite work correctly in Vim and won't give you a transparent terminal background, so we still use Inkpot in that case.

In Neovim, 'termguicolors' works perfectly - and in GVim it's moot since you're not using a terminal anyway. ;)
This commit is contained in:
Danielle McLean 2018-01-25 12:07:05 +11:00
parent cc1bb88103
commit 3fa6f409ab
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
2 changed files with 18 additions and 4 deletions

View file

@ -18,13 +18,25 @@ if !isdirectory($XDG_CACHE_HOME . '/vim/pack')
PackUpdate
endif
" Use Inkpot, since it's gorgeous, but with a transparent background instead
" of a solid black one.
augroup transparent_term
autocmd!
autocmd ColorScheme * highlight Normal ctermbg=NONE
autocmd ColorScheme * highlight Normal ctermbg=NONE guibg=NONE
augroup END
silent! colorscheme inkpot
set background=dark
let g:gruvbox_italic=1
let g:gruvbox_improved_strings=1
let g:gruvbox_improved_warnings=1
" The 'termguicolors' option is a little broken in Vim and can't have
" transparent background colours. It works totally fine in Neovim though.
if has('gui_running') || has('nvim')
set termguicolors
packadd gruvbox
let g:airline_theme = 'gruvbox'
colorscheme gruvbox
else
colorscheme inkpot
endif
inoremap jj <Esc>
nnoremap <C-t> :Files<CR>

View file

@ -14,6 +14,8 @@ call minpac#add('k-takata/minpac', {'type': 'opt'})
call minpac#add('tpope/vim-sensible')
call minpac#add('ciaranm/inkpot', {'type': 'opt', 'do': 'colorscheme inkpot'})
call minpac#add('morhetz/gruvbox', {'type': 'opt'})
call minpac#add('editorconfig/editorconfig-vim')
call minpac#add('jamessan/vim-gnupg')
call minpac#add('junegunn/fzf')