mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-12-23 00:27:34 +00:00
Catch error on first load where colorscheme may be missing
This commit is contained in:
parent
c16f793fb8
commit
8d0b6c26fe
@ -17,19 +17,6 @@ syntax on
|
|||||||
set hlsearch
|
set hlsearch
|
||||||
|
|
||||||
" Color Schemes {{
|
" Color Schemes {{
|
||||||
" Set theme based on $VIM_COLOR variable
|
|
||||||
try
|
|
||||||
if !empty($VIM_COLOR)
|
|
||||||
colorscheme $VIM_COLOR
|
|
||||||
else
|
|
||||||
" Prefered default colorscheme
|
|
||||||
colorscheme wombat256mod
|
|
||||||
endif
|
|
||||||
catch /^Vim\%((\a\+)\)\=:E185/
|
|
||||||
" Colorschemes not installed yet
|
|
||||||
" This happens when first installing bundles
|
|
||||||
colorscheme default
|
|
||||||
endtry
|
|
||||||
|
|
||||||
" Function and command to update colors based on light and dark mode
|
" Function and command to update colors based on light and dark mode
|
||||||
function! UpdateColors()
|
function! UpdateColors()
|
||||||
@ -65,8 +52,21 @@ function! UpdateColors()
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
command! UpdateColors call UpdateColors()
|
command! UpdateColors call UpdateColors()
|
||||||
" au BufEnter *.* call UpdateColors()
|
|
||||||
call UpdateColors()
|
" Set theme based on $VIM_COLOR variable
|
||||||
|
try
|
||||||
|
if !empty($VIM_COLOR)
|
||||||
|
colorscheme $VIM_COLOR
|
||||||
|
else
|
||||||
|
" Prefered default colorscheme
|
||||||
|
colorscheme wombat256mod
|
||||||
|
endif
|
||||||
|
call UpdateColors()
|
||||||
|
catch /^Vim\%((\a\+)\)\=:E185/
|
||||||
|
" Colorschemes not installed yet
|
||||||
|
" This happens when first installing bundles
|
||||||
|
colorscheme default
|
||||||
|
endtry
|
||||||
" }}
|
" }}
|
||||||
|
|
||||||
" Set gui specific values {{
|
" Set gui specific values {{
|
||||||
|
Loading…
Reference in New Issue
Block a user