From 20b0c4c0253810d9e55693ca46688b2af975b9c9 Mon Sep 17 00:00:00 2001 From: Lifepillar Date: Sat, 28 Oct 2017 22:02:26 +0200 Subject: [PATCH] Add script to parse all the templates. --- templates/make_colorschemes.vim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 templates/make_colorschemes.vim diff --git a/templates/make_colorschemes.vim b/templates/make_colorschemes.vim new file mode 100644 index 0000000..e8f9e9f --- /dev/null +++ b/templates/make_colorschemes.vim @@ -0,0 +1,24 @@ +" Source this script to parse all the templates in this folder and +" generate corresponding colorschemes in the colors folder (the colors folder +" will be created if it does not exist). +" Note: existing files in the colors folder are overridden. + +let s:curdir = fnamemodify(resolve(expand(':p')), ':h') +let s:parent = fnamemodify(s:curdir, ':h') +let s:errors = 0 + +for s:template in glob(s:curdir . '/*.colortemplate', 1, 1) + let s:template_name = fnamemodify(s:template, ':t:r') + execute "edit" s:template + execute "Colortemplate!" fnameescape(s:parent) + if g:colortemplate_exit_status != 0 + echoerr 'ERROR:' s:template_name 'could not be built' + let s:errors = 1 + endif +endfor + +if s:errors > 0 + redraw + echo "\r" + echoerr "There were errors: see messages" +endif