From 8d0b6c26fedd13103d39c71f1565a640a5a75b66 Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Thu, 24 Oct 2019 14:12:44 -0700 Subject: [PATCH] Catch error on first load where colorscheme may be missing --- vim/rc/ui.rc.vim | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/vim/rc/ui.rc.vim b/vim/rc/ui.rc.vim index 83ef1a2..1d035fd 100644 --- a/vim/rc/ui.rc.vim +++ b/vim/rc/ui.rc.vim @@ -17,19 +17,6 @@ syntax on set hlsearch " 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! UpdateColors() @@ -65,8 +52,21 @@ function! UpdateColors() endif endfunction 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 {{