From 12d43a7ae844f47f5342beb53b2f1d7aab2c3650 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 29 Oct 2017 17:36:48 +1300 Subject: 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. --- vim/vimrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'vim/vimrc') 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 -- cgit v1.2.3