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 / procmail.vim < prev    next >
Encoding:
Text File  |  2001-05-10  |  2.3 KB  |  67 lines

  1. " Vim syntax file
  2. " Language:    Procmail definition file
  3. " Maintainer:    vacancy [posted by Sonia Heimann, but she didn't feel like
  4. "        maintaining this]
  5. " Last Change:    2001 May 10
  6.  
  7. " For version 5.x: Clear all syntax items
  8. " For version 6.x: Quit when a syntax file was already loaded
  9. if version < 600
  10.   syntax clear
  11. elseif exists("b:current_syntax")
  12.   finish
  13. endif
  14.  
  15. syn match   procmailComment      "#.*$" contains=procmailTodo
  16. syn keyword   procmailTodo      contained Todo TBD
  17.  
  18. syn region  procmailString       start=+"+  skip=+\\"+  end=+"+
  19.  
  20. syn region procmailVarDeclRegion start="^\s*[a-zA-Z0-9_]\+\s*="hs=e-1 skip=+\\$+ end=+$+ contains=procmailVar,procmailVarDecl,procmailString
  21. syn match procmailVarDecl contained "^\s*[a-zA-Z0-9_]\+"
  22. syn match procmailVar "$[a-zA-Z0-9_]\+"
  23.  
  24. syn match procmailCondition contained "^\s*\*.*"
  25.  
  26. syn match procmailActionFolder contained "^\s*[-_a-zA-Z0-9/]\+"
  27. syn match procmailActionVariable contained "^\s*$[a-zA-Z_]\+"
  28. syn region procmailActionForward start=+^\s*!+ skip=+\\$+ end=+$+
  29. syn region procmailActionPipe start=+^\s*|+ skip=+\\$+ end=+$+
  30. syn region procmailActionNested start=+^\s*{+ end=+^\s*}+ contains=procmailRecipe,procmailComment,procmailVarDeclRegion
  31.  
  32. syn region procmailRecipe start=+^\s*:.*$+ end=+^\s*\($\|}\)+me=e-1 contains=procmailComment,procmailCondition,procmailActionFolder,procmailActionVariable,procmailActionForward,procmailActionPipe,procmailActionNested,procmailVarDeclRegion
  33.  
  34. " Define the default highlighting.
  35. " For version 5.7 and earlier: only when not done already
  36. " For version 5.8 and later: only when an item doesn't have highlighting yet
  37. if version >= 508 || !exists("did_procmail_syntax_inits")
  38.   if version < 508
  39.     let did_procmail_syntax_inits = 1
  40.     command -nargs=+ HiLink hi link <args>
  41.   else
  42.     command -nargs=+ HiLink hi def link <args>
  43.   endif
  44.  
  45.   HiLink procmailComment Comment
  46.   HiLink procmailTodo    Todo
  47.  
  48.   HiLink procmailRecipe   Statement
  49.   "HiLink procmailCondition   Statement
  50.  
  51.   HiLink procmailActionFolder    procmailAction
  52.   HiLink procmailActionVariable procmailAction
  53.   HiLink procmailActionForward    procmailAction
  54.   HiLink procmailActionPipe    procmailAction
  55.   HiLink procmailAction        Function
  56.   HiLink procmailVar        Identifier
  57.   HiLink procmailVarDecl    Identifier
  58.  
  59.   HiLink procmailString String
  60.  
  61.   delcommand HiLink
  62. endif
  63.  
  64. let b:current_syntax = "procmail"
  65.  
  66. " vim: ts=8
  67.