From ef30ab56abc955593879f1348c4097cf956177b7 Mon Sep 17 00:00:00 2001 From: Jin Yi Date: Fri, 13 May 2011 16:04:20 -0700 Subject: [PATCH] jinja.vim subsumes htmljinja.vim --- ext/Vim/htmljinja.vim | 27 --------------------------- ext/Vim/jinja.vim | 28 +++++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 30 deletions(-) delete mode 100644 ext/Vim/htmljinja.vim diff --git a/ext/Vim/htmljinja.vim b/ext/Vim/htmljinja.vim deleted file mode 100644 index 3f9cba4..0000000 --- a/ext/Vim/htmljinja.vim +++ /dev/null @@ -1,27 +0,0 @@ -" Vim syntax file -" Language: Jinja HTML template -" Maintainer: Armin Ronacher -" Last Change: 2007 Apr 8 - -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish -endif - -if !exists("main_syntax") - let main_syntax = 'html' -endif - -if version < 600 - so :p:h/jinja.vim - so :p:h/html.vim -else - runtime! syntax/jinja.vim - runtime! syntax/html.vim - unlet b:current_syntax -endif - -let b:current_syntax = "htmljinja" diff --git a/ext/Vim/jinja.vim b/ext/Vim/jinja.vim index 919954b..894dcc4 100644 --- a/ext/Vim/jinja.vim +++ b/ext/Vim/jinja.vim @@ -12,13 +12,31 @@ " " 2008 May 9: Added support for Jinja2 changes (new keyword rules) +" .vimrc variable to disable html highlighting +if !exists('g:jinja_syntax_html') + let g:jinja_syntax_html=1 +endif + " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +if !exists("main_syntax") + if version < 600 + syntax clear + elseif exists("b:current_syntax") finish endif + let main_syntax = 'jinja' +endif + +" Pull in the HTML syntax. +if g:jinja_syntax_html + if version < 600 + so :p:h/html.vim + else + runtime! syntax/html.vim + unlet b:current_syntax + endif +endif syntax case match @@ -111,3 +129,7 @@ if version >= 508 || !exists("did_jinja_syn_inits") endif let b:current_syntax = "jinja" + +if main_syntax == 'jinja' + unlet main_syntax +endif -- 2.26.2