2 " Language: Smarty Templates
3 " Maintainer: Manfred Stienstra manfred.stienstra@dwerg.net
4 " Last Change: Mon Nov 4 11:42:23 CET 2002
6 " URL: http://www.dwerg.net/projects/vim/smarty.vim
8 " For version 5.x: Clear all syntax items
9 " For version 6.x: Quit when a syntax file was already loaded
10 if !exists("main_syntax")
13 elseif exists("b:current_syntax")
16 let main_syntax = 'smarty'
21 runtime! syntax/html.vim
22 "syn cluster htmlPreproc add=smartyUnZone
24 syn match smartyBlock contained "[\[\]]"
26 syn keyword smartyTagName capture config_load include include_php
27 syn keyword smartyTagName insert if elseif else ldelim rdelim literal
28 syn keyword smartyTagName php section sectionelse foreach foreachelse
29 syn keyword smartyTagName strip assign counter cycle debug eval fetch
30 syn keyword smartyTagName html_options html_select_date html_select_time
31 syn keyword smartyTagName math popup_init popup html_checkboxes html_image
32 syn keyword smartyTagName html_radios html_table mailto textformat
34 syn keyword smartyModifier cat capitalize count_characters count_paragraphs
35 syn keyword smartyModifier count_sentences count_words date_format default
36 syn keyword smartyModifier escape indent lower nl2br regex_replace replace
37 syn keyword smartyModifier spacify string_format strip strip_tags truncate
38 syn keyword smartyModifier upper wordwrap
40 syn keyword smartyInFunc neq eq
42 syn keyword smartyProperty contained "file="
43 syn keyword smartyProperty contained "loop="
44 syn keyword smartyProperty contained "name="
45 syn keyword smartyProperty contained "include="
46 syn keyword smartyProperty contained "skip="
47 syn keyword smartyProperty contained "section="
49 syn keyword smartyConstant "\$smarty"
51 syn keyword smartyDot .
53 syn region smartyZone matchgroup=Delimiter start="{" end="}" contains=smartyProperty, smartyString, smartyBlock, smartyTagName, smartyConstant, smartyInFunc, smartyModifier
55 syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,smartyZone
56 syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,smartyZone
57 syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc,smartyZone
60 if version >= 508 || !exists("did_smarty_syn_inits")
62 let did_smarty_syn_inits = 1
63 command -nargs=+ HiLink hi link <args>
65 command -nargs=+ HiLink hi def link <args>
68 HiLink smartyTagName Identifier
69 HiLink smartyProperty Constant
70 " if you want the text inside the braces to be colored, then
71 " remove the comment in from of the next statement
72 "HiLink smartyZone Include
73 HiLink smartyInFunc Function
74 HiLink smartyBlock Constant
75 HiLink smartyDot SpecialChar
76 HiLink smartyModifier Function
80 let b:current_syntax = "smarty"
82 if main_syntax == 'smarty'