annotate runtime/syntax/smarty.vim @ 2150:4269a0673478 v7.2.432

updated for version 7.2.432 Problem: When menus are translated they can only be found by the translated name. That makes ":emenu" difficult to use. Solution: Store the untranslated name and use it for completion and :emenu. (Edward L. Fox / Liang Peng / Bezetek James)
author Bram Moolenaar <bram@zimbu.org>
date Fri, 14 May 2010 22:24:40 +0200
parents 3fc0f57ecb91
children 43efa4f5a8ea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Smarty Templates
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Manfred Stienstra manfred.stienstra@dwerg.net
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " Last Change: Mon Nov 4 11:42:23 CET 2002
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " Filenames: *.tpl
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " URL: http://www.dwerg.net/projects/vim/smarty.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 if !exists("main_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 let main_syntax = 'smarty'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 syn case ignore
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 runtime! syntax/html.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 "syn cluster htmlPreproc add=smartyUnZone
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 syn match smartyBlock contained "[\[\]]"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 syn keyword smartyTagName capture config_load include include_php
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 syn keyword smartyTagName insert if elseif else ldelim rdelim literal
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 syn keyword smartyTagName php section sectionelse foreach foreachelse
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 syn keyword smartyTagName strip assign counter cycle debug eval fetch
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 syn keyword smartyTagName html_options html_select_date html_select_time
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 syn keyword smartyTagName math popup_init popup html_checkboxes html_image
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 syn keyword smartyTagName html_radios html_table mailto textformat
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword smartyModifier cat capitalize count_characters count_paragraphs
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35 syn keyword smartyModifier count_sentences count_words date_format default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn keyword smartyModifier escape indent lower nl2br regex_replace replace
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 syn keyword smartyModifier spacify string_format strip strip_tags truncate
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 syn keyword smartyModifier upper wordwrap
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn keyword smartyInFunc neq eq
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn keyword smartyProperty contained "file="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 syn keyword smartyProperty contained "loop="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 syn keyword smartyProperty contained "name="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn keyword smartyProperty contained "include="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn keyword smartyProperty contained "skip="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn keyword smartyProperty contained "section="
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 syn keyword smartyConstant "\$smarty"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 syn keyword smartyDot .
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn region smartyZone matchgroup=Delimiter start="{" end="}" contains=smartyProperty, smartyString, smartyBlock, smartyTagName, smartyConstant, smartyInFunc, smartyModifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,smartyZone
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,smartyZone
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc,smartyZone
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 if version >= 508 || !exists("did_smarty_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 let did_smarty_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 HiLink smartyTagName Identifier
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 HiLink smartyProperty Constant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 " if you want the text inside the braces to be colored, then
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 " remove the comment in from of the next statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 "HiLink smartyZone Include
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 HiLink smartyInFunc Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 HiLink smartyBlock Constant
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 HiLink smartyDot SpecialChar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 HiLink smartyModifier Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 let b:current_syntax = "smarty"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 if main_syntax == 'smarty'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 unlet main_syntax
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 " vim: ts=8