blob: 58afd1b62d095e58ec7cd0f4bdf6089f7a968975 [file] [log] [blame]
Bram Moolenaardb552d602006-03-23 22:59:57 +00001" Vim syntax file
2" Language: Django HTML template
3" Maintainer: Dave Hodder <dmh@dmh.org.uk>
Bram Moolenaardbc28022014-07-26 13:40:44 +02004" Last Change: 2014 Jul 13
Bram Moolenaardb552d602006-03-23 22:59:57 +00005
6" For version 5.x: Clear all syntax items
7" For version 6.x: Quit when a syntax file was already loaded
8if version < 600
9 syntax clear
10elseif exists("b:current_syntax")
11 finish
12endif
13
14if !exists("main_syntax")
15 let main_syntax = 'html'
16endif
17
18if version < 600
19 so <sfile>:p:h/django.vim
20 so <sfile>:p:h/html.vim
21else
22 runtime! syntax/django.vim
23 runtime! syntax/html.vim
24 unlet b:current_syntax
25endif
26
Bram Moolenaarc81e5e72007-05-05 18:24:42 +000027syn cluster djangoBlocks add=djangoTagBlock,djangoVarBlock,djangoComment,djangoComBlock
28
29syn region djangoTagBlock start="{%" end="%}" contains=djangoStatement,djangoFilter,djangoArgument,djangoTagError display containedin=ALLBUT,@djangoBlocks
30syn region djangoVarBlock start="{{" end="}}" contains=djangoFilter,djangoArgument,djangoVarError display containedin=ALLBUT,@djangoBlocks
Bram Moolenaardbc28022014-07-26 13:40:44 +020031syn region djangoComment start="{%\s*comment\(\s\+.\{-}\)\?%}" end="{%\s*endcomment\s*%}" contains=djangoTodo containedin=ALLBUT,@djangoBlocks
Bram Moolenaarc81e5e72007-05-05 18:24:42 +000032syn region djangoComBlock start="{#" end="#}" contains=djangoTodo containedin=ALLBUT,@djangoBlocks
Bram Moolenaardb552d602006-03-23 22:59:57 +000033
34let b:current_syntax = "htmldjango"