blob: 07b1c375e8652111c6cbddd16578216a0d533128 [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
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02006" quit when a syntax file was already loaded
7if exists("b:current_syntax")
Bram Moolenaardb552d602006-03-23 22:59:57 +00008 finish
9endif
10
11if !exists("main_syntax")
12 let main_syntax = 'html'
13endif
14
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020015runtime! syntax/django.vim
16runtime! syntax/html.vim
17unlet b:current_syntax
Bram Moolenaardb552d602006-03-23 22:59:57 +000018
Bram Moolenaarc81e5e72007-05-05 18:24:42 +000019syn cluster djangoBlocks add=djangoTagBlock,djangoVarBlock,djangoComment,djangoComBlock
20
21syn region djangoTagBlock start="{%" end="%}" contains=djangoStatement,djangoFilter,djangoArgument,djangoTagError display containedin=ALLBUT,@djangoBlocks
22syn region djangoVarBlock start="{{" end="}}" contains=djangoFilter,djangoArgument,djangoVarError display containedin=ALLBUT,@djangoBlocks
Bram Moolenaardbc28022014-07-26 13:40:44 +020023syn region djangoComment start="{%\s*comment\(\s\+.\{-}\)\?%}" end="{%\s*endcomment\s*%}" contains=djangoTodo containedin=ALLBUT,@djangoBlocks
Bram Moolenaarc81e5e72007-05-05 18:24:42 +000024syn region djangoComBlock start="{#" end="#}" contains=djangoTodo containedin=ALLBUT,@djangoBlocks
Bram Moolenaardb552d602006-03-23 22:59:57 +000025
26let b:current_syntax = "htmldjango"