2 " Language: Procmail definition file
3 " Maintainer: vacancy [posted by Sonia Heimann, but she didn't feel like
5 " Last Change: 2001 May 10
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=+"+
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_]\+"
24 syn match procmailCondition contained "^\s*\*.*"
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
32 syn region procmailRecipe start=+^\s*:.*$+ end=+^\s*\($\|}\)+me=e-1 contains=procmailComment,procmailCondition,procmailActionFolder,procmailActionVariable,procmailActionForward,procmailActionPipe,procmailActionNested,procmailVarDeclRegion
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")
39 let did_procmail_syntax_inits = 1
40 command -nargs=+ HiLink hi link <args>
42 command -nargs=+ HiLink hi def link <args>
45 HiLink procmailComment Comment
46 HiLink procmailTodo Todo
48 HiLink procmailRecipe Statement
49 "HiLink procmailCondition Statement
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
59 HiLink procmailString String
64 let b:current_syntax = "procmail"