Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

jinja.vim subsumes htmljinja.vim

  • Loading branch information...
commit ef30ab56abc955593879f1348c4097cf956177b7 1 parent 7c97352
@razamatan razamatan authored
Showing with 25 additions and 30 deletions.
  1. +0 −27 ext/Vim/htmljinja.vim
  2. +25 −3 ext/Vim/jinja.vim
View
27 ext/Vim/htmljinja.vim
@@ -1,27 +0,0 @@
-" Vim syntax file
-" Language: Jinja HTML template
-" Maintainer: Armin Ronacher <armin.ronacher@active-4.com>
-" 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 <sfile>:p:h/jinja.vim
- so <sfile>:p:h/html.vim
-else
- runtime! syntax/jinja.vim
- runtime! syntax/html.vim
- unlet b:current_syntax
-endif
-
-let b:current_syntax = "htmljinja"
View
28 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 <sfile>: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
Please sign in to comment.
Something went wrong with that request. Please try again.