aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-10 14:34:01 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-10 14:34:41 +1200
commit821828153e933396a7033061701582c4764dac92 (patch)
treebaf219eea0aa86824c6cf9a4cb9b11387fd7f572
parentRemove Vim 'grepprg' setting (diff)
downloaddotfiles-821828153e933396a7033061701582c4764dac92.tar.gz
dotfiles-821828153e933396a7033061701582c4764dac92.zip
Refactor colorscheme logic a little
-rw-r--r--vim/vimrc22
1 files changed, 13 insertions, 9 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 5eb139dd..6b85ea37 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -27,21 +27,25 @@ if has('syntax')
syntax enable
endif
- " Use my colorscheme if using the GUI or if we have 256 colors
- if has('gui_running') || &t_Co >= 256
- silent! colorscheme sahara
- endif
+ " Colorscheme handling
+ try
+
+ " Use sahara.vim colorscheme, if using gVim or a 256-color term
+ if has('gui_running') || &t_Co >= 256
+ colorscheme sahara
+ else
+ throw 'Not loading sahara on this terminal'
+ endif
- " If my colorscheme loaded, turn on subtle 'cursorline' coloring
- if exists('colors_name') && colors_name ==# 'sahara'
+ " Use the colorscheme's subtle 'cursorline', if it loaded
if exists('+cursorline')
set cursorline
endif
- " If it didn't load, default to default scheme with dark background
- else
+ " Otherwise, use the default colorscheme with a dark background
+ catch
set background=dark
- endif
+ endtry
endif