aboutsummaryrefslogtreecommitdiff
path: root/vim/vimrc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-10-29 17:36:48 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-10-29 17:36:48 +1300
commit12d43a7ae844f47f5342beb53b2f1d7aab2c3650 (patch)
tree440fd4b564ea598d4c7d942e8c4ef9c74c8e534e /vim/vimrc
parentAdd explanatory comment for Vim 'nocompatible' (diff)
downloaddotfiles-12d43a7ae844f47f5342beb53b2f1d7aab2c3650.tar.gz
dotfiles-12d43a7ae844f47f5342beb53b2f1d7aab2c3650.zip
Test whether to load sahara colorscheme
This is in preparation for config in vim/config/syntax.vim that will do a more comprehensive job of applying heuristics to figure out if the background is light or dark and hence what colours should be loaded for the appropriate scheme. The test for the GUI or 256 colours is repeated in the colorscheme code itself, but I think that's OK given that sahara.vim is distributed separately and others probably wouldn't use the kind of guards introduced in this commit.
Diffstat (limited to 'vim/vimrc')
-rw-r--r--vim/vimrc4
1 files changed, 3 insertions, 1 deletions
diff --git a/vim/vimrc b/vim/vimrc
index d225a148..043dea8b 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -24,8 +24,10 @@ if v:version >= 701
silent! call pathogen#infect()
silent! call pathogen#helptags()
- " With the plugins loaded, we might now be able to use my custom colorscheme
+ " The 'sahara' colorscheme only works for dark backgrounds with 256 colors
if has('syntax')
+ \ && &background == 'dark'
+ \ && (has('gui_running') || &t_Co == 256)
silent! colorscheme sahara
endif
endif