From 3fa6f409ab41d927b0a67b1429ddfba4c71754ee Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Thu, 25 Jan 2018 12:07:05 +1100 Subject: [PATCH] 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. ;) --- config/vim/init.vim | 20 ++++++++++++++++---- config/vim/plugins.vim | 2 ++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/config/vim/init.vim b/config/vim/init.vim index 3ec4ebb..ce87e48 100644 --- a/config/vim/init.vim +++ b/config/vim/init.vim @@ -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 nnoremap :Files diff --git a/config/vim/plugins.vim b/config/vim/plugins.vim index e2d0121..c244c9d 100644 --- a/config/vim/plugins.vim +++ b/config/vim/plugins.vim @@ -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')