From 1afe5384449d6b95fabcca42f5973f6714c815ab Mon Sep 17 00:00:00 2001 From: Ludovic Koenig Date: Sun, 3 Mar 2019 14:53:31 +0100 Subject: [PATCH] Add the initialisation step The initialisation step consists in cleaning the highlights and the syntax from previous schemes, and setting the background accordingly. Plus, the variables used within the script are also initialized. It must be noted that the colorscheme is only defined for the GUI and for versions of Vim that has the 'termguicolors' option set. In addition the version must be greater than '580'. --- colors/odyssey.vim | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/colors/odyssey.vim b/colors/odyssey.vim index 2399197..22479f6 100644 --- a/colors/odyssey.vim +++ b/colors/odyssey.vim @@ -15,9 +15,24 @@ " Maintainer: Ludovic Koenig " License: MIT " -" Bootstrap {{{ +" Initialisation {{{ + +if !(has('termguicolors') && &termguicolors) && !has('gui_running') + finish +endif + +if v:version > 580 + set background=dark + highlight clear + if exists('syntax_on') + syntax reset + endif +else + finish +endif + +let g:colors_name = 'odyssey' -" TODO Improve the bootstrap process ;-) let s:colors = {} " }}}