vim/syntax/htmlten.vim @ 8e22b36e5cba

More
author Steve Losh <steve@stevelosh.com>
date Wed, 17 Jul 2024 15:51:26 -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"