home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / unix / vim-6.2.tar.bz2 / vim-6.2.tar / vim62 / runtime / syntax / smarty.vim < prev    next >
Encoding:
Text File  |  2003-04-25  |  2.4 KB  |  77 lines

  1. " Vim syntax file
  2. " Language:    Smarty Templates (http://www.phpinsider.com/php/code/Smarty/)
  3. " Maintainer:    Manfred Stienstra manfred.stienstra@dwerg.net
  4. " Last Change:  Fri Apr 12 10:33:51 CEST 2002
  5. " Filenames:    *.tpl
  6. " URL:        http://www.dwerg.net/download/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
  10. if !exists("main_syntax")
  11.   if version < 600
  12.     syntax clear
  13.   elseif exists("b:current_syntax")
  14.   finish
  15. endif
  16.   let main_syntax = 'smarty'
  17. endif
  18.  
  19. syn case ignore
  20.  
  21. runtime! syntax/html.vim
  22. "syn cluster htmlPreproc add=smartyUnZone
  23.  
  24. syn match smartyBlock contained "[\[\]]"
  25.  
  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
  30.  
  31. syn keyword smartyInFunc ne eq
  32.  
  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.  
  40. syn keyword smartyConstant "\$smarty"
  41.  
  42. syn keyword smartyDot .
  43.  
  44. syn region smartyZone matchgroup=Delimiter start="{" end="}" contains=smartyProperty, smartyString, smartyBlock, smartyTagName, smartyConstant, smartyInFunc
  45.  
  46. syn region  htmlString   contained start=+"+ end=+"+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,smartyZone
  47. syn region  htmlString   contained start=+'+ end=+'+ contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc,smartyZone
  48.   syn region htmlLink start="<a\>\_[^>]*\<href\>" end="</a>"me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc,smartyZone
  49.  
  50.  
  51. if version >= 508 || !exists("did_smarty_syn_inits")
  52.   if version < 508
  53.     let did_smarty_syn_inits = 1
  54.     command -nargs=+ HiLink hi link <args>
  55.   else
  56.     command -nargs=+ HiLink hi def link <args>
  57.   endif
  58.  
  59.   HiLink smartyTagName Identifier
  60.   HiLink smartyProperty Constant
  61.   " if you want the text inside the braces to be colored, then
  62.   " remove the comment in from of the next statement
  63.   "HiLink smartyZone Include
  64.   HiLink smartyInFunc Function
  65.   HiLink smartyBlock Constant
  66.   HiLink smartyDot SpecialChar
  67.   delcommand HiLink
  68. endif
  69.  
  70. let b:current_syntax = "smarty"
  71.  
  72. if main_syntax == 'smarty'
  73.   unlet main_syntax
  74. endif
  75.  
  76. " vim: ts=8
  77.