aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-06-20 21:55:32 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-06-20 21:55:32 +1200
commit29bd85016d16e3b48de35dc904b651f59bedda91 (patch)
treebaa0b14b280cf0de20e567626447eb9376405a6c
parentRemove some unneeded silencing (diff)
downloaddotfiles-29bd85016d16e3b48de35dc904b651f59bedda91.tar.gz
dotfiles-29bd85016d16e3b48de35dc904b651f59bedda91.zip
Refine colorscheme selection logic
-rw-r--r--vim/vimrc12
1 files changed, 7 insertions, 5 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 450e1317..3ac53e2c 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -29,15 +29,17 @@ if has('syntax') && !has('g:syntax_on')
" Use syntax highlighting
syntax enable
- " Opinionated; if the author is using color at all, it will probably be with
- " a dark background
- set background=dark
-
- " The 'sahara' colorscheme only works in the GUI or with 256 colors
+ " Use the 'sahara' colorscheme if using the GUI or if we have 256 colors
if has('gui_running') || &t_Co >= 256
silent! colorscheme sahara
endif
+ " If we couldn't use 'sahara', just flag a dark background (the author is
+ " almost certainly using one), and we'll use the default colorscheme
+ if !exists('g:colors_name') || g:colors_name != 'sahara'
+ set background=dark
+ endif
+
endif
" Let me backspace over pretty much anything