smarty.vim 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. " 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. " For version 5.x: Clear all syntax items
  8. " For version 6.x: Quit when a syntax file was already loaded
  9. if !exists("main_syntax")
  10. " quit when a syntax file was already loaded
  11. if exists("b:current_syntax")
  12. finish
  13. endif
  14. let main_syntax = 'smarty'
  15. endif
  16. syn case ignore
  17. runtime! syntax/html.vim
  18. "syn cluster htmlPreproc add=smartyUnZone
  19. syn match smartyBlock contained "[\[\]]"
  20. syn keyword smartyTagName capture config_load include include_php
  21. syn keyword smartyTagName insert if elseif else ldelim rdelim literal
  22. syn keyword smartyTagName php section sectionelse foreach foreachelse
  23. syn keyword smartyTagName strip assign counter cycle debug eval fetch
  24. syn keyword smartyTagName html_options html_select_date html_select_time
  25. syn keyword smartyTagName math popup_init popup html_checkboxes html_image
  26. syn keyword smartyTagName html_radios html_table mailto textformat
  27. syn keyword smartyModifier cat capitalize count_characters count_paragraphs
  28. syn keyword smartyModifier count_sentences count_words date_format default
  29. syn keyword smartyModifier escape indent lower nl2br regex_replace replace
  30. syn keyword smartyModifier spacify string_format strip strip_tags truncate
  31. syn keyword smartyModifier upper wordwrap
  32. syn keyword smartyInFunc neq eq
  33. syn keyword smartyProperty contained "file="
  34. syn keyword smartyProperty contained "loop="
  35. syn keyword smartyProperty contained "name="
  36. syn keyword smartyProperty contained "include="
  37. syn keyword smartyProperty contained "skip="
  38. syn keyword smartyProperty contained "section="
  39. syn keyword smartyConstant "\$smarty"
  40. syn keyword smartyDot .
  41. syn region smartyZone matchgroup=Delimiter start="{" end="}" contains=smartyProperty, smartyString, smartyBlock, smartyTagName, smartyConstant, smartyInFunc, smartyModifier
  42. syn region htmlString contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,smartyZone
  43. syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,smartyZone
  44. syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc,smartyZone
  45. hi def link smartyTagName Identifier
  46. hi def link smartyProperty Constant
  47. " if you want the text inside the braces to be colored, then
  48. " remove the comment in from of the next statement
  49. "hi def link smartyZone Include
  50. hi def link smartyInFunc Function
  51. hi def link smartyBlock Constant
  52. hi def link smartyDot SpecialChar
  53. hi def link smartyModifier Function
  54. let b:current_syntax = "smarty"
  55. if main_syntax == 'smarty'
  56. unlet main_syntax
  57. endif
  58. " vim: ts=8