blob: 6dda366ba283ddfed2cb3e093a582789ccd20b3a [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: Smarty Templates
3" Maintainer: Manfred Stienstra manfred.stienstra@dwerg.net
4" Last Change: Mon Nov 4 11:42:23 CET 2002
5" Filenames: *.tpl
6" URL: http://www.dwerg.net/projects/vim/smarty.vim
7
8" For version 5.x: Clear all syntax items
9" For version 6.x: Quit when a syntax file was already loaded
10if !exists("main_syntax")
11 if version < 600
12 syntax clear
13 elseif exists("b:current_syntax")
14 finish
15endif
16 let main_syntax = 'smarty'
17endif
18
19syn case ignore
20
21runtime! syntax/html.vim
22"syn cluster htmlPreproc add=smartyUnZone
23
24syn match smartyBlock contained "[\[\]]"
25
26syn keyword smartyTagName capture config_load include include_php
27syn keyword smartyTagName insert if elseif else ldelim rdelim literal
28syn keyword smartyTagName php section sectionelse foreach foreachelse
29syn keyword smartyTagName strip assign counter cycle debug eval fetch
30syn keyword smartyTagName html_options html_select_date html_select_time
31syn keyword smartyTagName math popup_init popup html_checkboxes html_image
32syn keyword smartyTagName html_radios html_table mailto textformat
33
34syn keyword smartyModifier cat capitalize count_characters count_paragraphs
35syn keyword smartyModifier count_sentences count_words date_format default
36syn keyword smartyModifier escape indent lower nl2br regex_replace replace
37syn keyword smartyModifier spacify string_format strip strip_tags truncate
38syn keyword smartyModifier upper wordwrap
39
40syn keyword smartyInFunc neq eq
41
42syn keyword smartyProperty contained "file="
43syn keyword smartyProperty contained "loop="
44syn keyword smartyProperty contained "name="
45syn keyword smartyProperty contained "include="
46syn keyword smartyProperty contained "skip="
47syn keyword smartyProperty contained "section="
48
49syn keyword smartyConstant "\$smarty"
50
51syn keyword smartyDot .
52
53syn region smartyZone matchgroup=Delimiter start="{" end="}" contains=smartyProperty, smartyString, smartyBlock, smartyTagName, smartyConstant, smartyInFunc, smartyModifier
54
55syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,smartyZone
56syn 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
58
59
60if version >= 508 || !exists("did_smarty_syn_inits")
61 if version < 508
62 let did_smarty_syn_inits = 1
63 command -nargs=+ HiLink hi link <args>
64 else
65 command -nargs=+ HiLink hi def link <args>
66 endif
67
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
77 delcommand HiLink
78endif
79
80let b:current_syntax = "smarty"
81
82if main_syntax == 'smarty'
83 unlet main_syntax
84endif
85
86" vim: ts=8