vim/syntax/htmlten.vim @ 6c4c335faf47
Merge
author |
Steve Losh <steve@stevelosh.com> |
date |
Tue, 06 Aug 2024 10:56:16 -0400 |
parents |
f77ee236cdf3 |
children |
(none) |
" based on the htmldjango syntax
if exists("b:current_syntax")
finish
endif
if !exists("main_syntax")
let main_syntax = 'html'
endif
runtime! syntax/html.vim
unlet b:current_syntax
syn region tenArgument contained start=/"/ skip=/\\"/ end=/"/
syn match tenError "%}\|}}\|#}"
syn match tenTagError contained "#}\|{{\|[^%]}}\|[#]"
syn match tenVarError contained "#}\|{%\|%}\|[<>!#]"
syn cluster tenBlocks add=tenTagBlock,tenVarBlock,tenComment,tenComBlock
syn region tenTagBlock start="{%" end="%}" contains=tenArgument,tenTagError display containedin=ALLBUT,@djangoBlocks
syn region tenVarBlock start="{{" end="}}" contains=tenArgument,tenVarError display containedin=ALLBUT,@djangoBlocks
syn region tenComment start="{%\s*comment\(\s\+.\{-}\)\?%}" end="{%\s*endcomment\s*%}" containedin=ALLBUT,@tenBlocks
syn region tenComBlock start="{#" end="#}" containedin=ALLBUT,@tenBlocks
hi def link tenTagBlock PreProc
hi def link tenVarBlock PreProc
hi def link tenComment Comment
hi def link tenComBlock Comment
hi def link tenArgument Constant
hi def link tenError Error
hi def link tenTagError Error
hi def link tenVarError Error
let b:current_syntax = "htmlten"