Use onedark.vim's interface to unset background

Instead of using bare Vim command to set background for onedark.vim use
the functions defined by the theme.  This approach works properly on
both, Vim and Neovim.
This commit is contained in:
Dionisio E Alonso 2019-04-04 11:54:42 -03:00
parent 28a0048042
commit bc0f1da598
2 changed files with 18 additions and 6 deletions

View File

@ -42,11 +42,17 @@ if exists('g:colors_name') && g:colors_name == 'aldmeris'
endif
packadd onedark.vim
" onedark.vim override: Don't set a background color when running in a
" terminal; just use the terminal's background color
if (has('autocmd') && !has('gui_running')
augroup colorset
autocmd!
autocmd ColorScheme * silent!
\ call onedark#extend_highlight('Normal', {'bg': {'gui': 'NONE'}})
augroup END
endif
silent! colorscheme onedark
if exists('g:colors_name') && g:colors_name == 'onedark'
if !has('gui_running')
highlight Normal guibg=NONE
endif
if has('termguicolors')
set termguicolors
endif

View File

@ -41,11 +41,17 @@ if exists('g:colors_name') && g:colors_name == 'aldmeris'
endif
packadd onedark.vim
" onedark.vim override: Don't set a background color when running in a
" terminal; just use the terminal's background color
if (has('autocmd') && !has('gui_running'))
augroup colorset
autocmd!
autocmd ColorScheme * silent!
\ call onedark#extend_highlight('Normal', {'bg': {'gui': 'NONE'}})
augroup END
endif
silent! colorscheme onedark
if exists('g:colors_name') && g:colors_name == 'onedark'
if !has('gui_running')
highlight Normal guibg=NONE
endif
if has('termguicolors')
set termguicolors
if !empty($TMUX) && (&term =~ 'tmux' || &term =~ 'screen')