2 " Language: Procmail definition file
3 " Maintainer: Melchior FRANZ <mfranz@aon.at>
4 " Last Change: 2003 Aug 14
5 " Author: Sonia Heimann
7 " For version 5.x: Clear all syntax items
8 " For version 6.x: Quit when a syntax file was already loaded
11 elseif exists("b:current_syntax")
15 syn match procmailComment "#.*$" contains=procmailTodo
16 syn keyword procmailTodo contained Todo TBD
18 syn region procmailString start=+"+ skip=+\\"+ end=+"+
19 syn region procmailString start=+'+ skip=+\\'+ end=+'+
21 syn region procmailVarDeclRegion start="^\s*[a-zA-Z0-9_]\+\s*="hs=e-1 skip=+\\$+ end=+$+ contains=procmailVar,procmailVarDecl,procmailString
22 syn match procmailVarDecl contained "^\s*[a-zA-Z0-9_]\+"
23 syn match procmailVar "$[a-zA-Z0-9_]\+"
25 syn match procmailCondition contained "^\s*\*.*"
27 syn match procmailActionFolder contained "^\s*[-_a-zA-Z0-9/]\+"
28 syn match procmailActionVariable contained "^\s*$[a-zA-Z_]\+"
29 syn region procmailActionForward start=+^\s*!+ skip=+\\$+ end=+$+
30 syn region procmailActionPipe start=+^\s*|+ skip=+\\$+ end=+$+
31 syn region procmailActionNested start=+^\s*{+ end=+^\s*}+ contains=procmailRecipe,procmailComment,procmailVarDeclRegion
33 syn region procmailRecipe start=+^\s*:.*$+ end=+^\s*\($\|}\)+me=e-1 contains=procmailComment,procmailCondition,procmailActionFolder,procmailActionVariable,procmailActionForward,procmailActionPipe,procmailActionNested,procmailVarDeclRegion
35 " Define the default highlighting.
36 " For version 5.7 and earlier: only when not done already
37 " For version 5.8 and later: only when an item doesn't have highlighting yet
38 if version >= 508 || !exists("did_procmail_syntax_inits")
40 let did_procmail_syntax_inits = 1
41 command -nargs=+ HiLink hi link <args>
43 command -nargs=+ HiLink hi def link <args>
46 HiLink procmailComment Comment
47 HiLink procmailTodo Todo
49 HiLink procmailRecipe Statement
50 "HiLink procmailCondition Statement
52 HiLink procmailActionFolder procmailAction
53 HiLink procmailActionVariable procmailAction
54 HiLink procmailActionForward procmailAction
55 HiLink procmailActionPipe procmailAction
56 HiLink procmailAction Function
57 HiLink procmailVar Identifier
58 HiLink procmailVarDecl Identifier
60 HiLink procmailString String
65 let b:current_syntax = "procmail"