blob: c2ffa3988306ea45ebda8deed69ac06faac1004f [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: Procmail definition file
3" Maintainer: Melchior FRANZ <mfranz@aon.at>
4" Last Change: 2003 Aug 14
5" Author: Sonia Heimann
6
7" For version 5.x: Clear all syntax items
8" For version 6.x: Quit when a syntax file was already loaded
9if version < 600
10 syntax clear
11elseif exists("b:current_syntax")
12 finish
13endif
14
15syn match procmailComment "#.*$" contains=procmailTodo
16syn keyword procmailTodo contained Todo TBD
17
18syn region procmailString start=+"+ skip=+\\"+ end=+"+
19syn region procmailString start=+'+ skip=+\\'+ end=+'+
20
21syn region procmailVarDeclRegion start="^\s*[a-zA-Z0-9_]\+\s*="hs=e-1 skip=+\\$+ end=+$+ contains=procmailVar,procmailVarDecl,procmailString
22syn match procmailVarDecl contained "^\s*[a-zA-Z0-9_]\+"
23syn match procmailVar "$[a-zA-Z0-9_]\+"
24
25syn match procmailCondition contained "^\s*\*.*"
26
27syn match procmailActionFolder contained "^\s*[-_a-zA-Z0-9/]\+"
28syn match procmailActionVariable contained "^\s*$[a-zA-Z_]\+"
29syn region procmailActionForward start=+^\s*!+ skip=+\\$+ end=+$+
30syn region procmailActionPipe start=+^\s*|+ skip=+\\$+ end=+$+
31syn region procmailActionNested start=+^\s*{+ end=+^\s*}+ contains=procmailRecipe,procmailComment,procmailVarDeclRegion
32
33syn region procmailRecipe start=+^\s*:.*$+ end=+^\s*\($\|}\)+me=e-1 contains=procmailComment,procmailCondition,procmailActionFolder,procmailActionVariable,procmailActionForward,procmailActionPipe,procmailActionNested,procmailVarDeclRegion
34
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
38if version >= 508 || !exists("did_procmail_syntax_inits")
39 if version < 508
40 let did_procmail_syntax_inits = 1
41 command -nargs=+ HiLink hi link <args>
42 else
43 command -nargs=+ HiLink hi def link <args>
44 endif
45
46 HiLink procmailComment Comment
47 HiLink procmailTodo Todo
48
49 HiLink procmailRecipe Statement
50 "HiLink procmailCondition Statement
51
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
59
60 HiLink procmailString String
61
62 delcommand HiLink
63endif
64
65let b:current_syntax = "procmail"
66
67" vim: ts=8