Merge branch 'hack/autopaste'
[vim-kana.git] / runtime / syntax / htmldjango.vim
blob4b13863c0612e107c5846de3d0b48b46d7e27fa2
1 " Vim syntax file
2 " Language:     Django HTML template
3 " Maintainer:   Dave Hodder <dmh@dmh.org.uk>
4 " Last Change:  2007 Jan 26
6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded
8 if version < 600
9   syntax clear
10 elseif exists("b:current_syntax")
11   finish
12 endif
14 if !exists("main_syntax")
15   let main_syntax = 'html'
16 endif
18 if version < 600
19   so <sfile>:p:h/django.vim
20   so <sfile>:p:h/html.vim
21 else
22   runtime! syntax/django.vim
23   runtime! syntax/html.vim
24   unlet b:current_syntax
25 endif
27 syn cluster djangoBlocks add=djangoTagBlock,djangoVarBlock,djangoComment,djangoComBlock
29 syn region djangoTagBlock start="{%" end="%}" contains=djangoStatement,djangoFilter,djangoArgument,djangoTagError display containedin=ALLBUT,@djangoBlocks
30 syn region djangoVarBlock start="{{" end="}}" contains=djangoFilter,djangoArgument,djangoVarError display containedin=ALLBUT,@djangoBlocks
31 syn region djangoComment start="{%\s*comment\s*%}" end="{%\s*endcomment\s*%}" contains=djangoTodo containedin=ALLBUT,@djangoBlocks
32 syn region djangoComBlock start="{#" end="#}" contains=djangoTodo containedin=ALLBUT,@djangoBlocks
34 let b:current_syntax = "htmldjango"