7
|
1 " Vim syntax file
|
|
2 " Language: sendmail
|
|
3 " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
|
507
|
4 " Last Change: Sep 06, 2005
|
|
5 " Version: 4
|
|
6 " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
|
7
|
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 version < 600
|
|
11 syntax clear
|
|
12 elseif exists("b:current_syntax")
|
|
13 finish
|
|
14 endif
|
|
15
|
|
16 " Comments
|
|
17 syn match smComment "^#.*$" contains=@Spell
|
|
18
|
|
19 " Definitions, Classes, Files, Options, Precedence, Trusted Users, Mailers
|
|
20 syn match smDefine "^[CDF]."
|
|
21 syn match smDefine "^O[AaBcdDeFfgHiLmNoQqrSsTtuvxXyYzZ]"
|
|
22 syn match smDefine "^O\s"he=e-1
|
|
23 syn match smDefine "^M[a-zA-Z0-9]\+,"he=e-1
|
|
24 syn match smDefine "^T" nextgroup=smTrusted
|
|
25 syn match smDefine "^P" nextgroup=smMesg
|
|
26 syn match smTrusted "\S\+$" contained
|
|
27 syn match smMesg "\S*="he=e-1 contained nextgroup=smPrecedence
|
|
28 syn match smPrecedence "-\=[0-9]\+" contained
|
|
29
|
|
30 " Header Format H?list-of-mailer-flags?name: format
|
|
31 syn match smHeaderSep contained "[?:]"
|
|
32 syn match smHeader "^H\(?[a-zA-Z]\+?\)\=[-a-zA-Z_]\+:" contains=smHeaderSep
|
|
33
|
|
34 " Variables
|
|
35 syn match smVar "\$[a-z\.\|]"
|
|
36
|
|
37 " Rulesets
|
|
38 syn match smRuleset "^S\d*"
|
|
39
|
|
40 " Rewriting Rules
|
|
41 syn match smRewrite "^R" skipwhite nextgroup=smRewriteLhsToken,smRewriteLhsUser
|
|
42
|
|
43 syn match smRewriteLhsUser contained "[^\t$]\+" skipwhite nextgroup=smRewriteLhsToken,smRewriteLhsSep
|
|
44 syn match smRewriteLhsToken contained "\(\$[-*+]\|\$[-=][A-Za-z]\|\$Y\)\+" skipwhite nextgroup=smRewriteLhsUser,smRewriteLhsSep
|
|
45
|
|
46 syn match smRewriteLhsSep contained "\t\+" skipwhite nextgroup=smRewriteRhsToken,smRewriteRhsUser
|
|
47
|
|
48 syn match smRewriteRhsUser contained "[^\t$]\+" skipwhite nextgroup=smRewriteRhsToken,smRewriteRhsSep
|
|
49 syn match smRewriteRhsToken contained "\(\$\d\|\$>\d\|\$#\|\$@\|\$:[-_a-zA-Z]\+\|\$[[\]]\|\$@\|\$:\|\$[A-Za-z]\)\+" skipwhite nextgroup=smRewriteRhsUser,smRewriteRhsSep
|
|
50
|
|
51 syn match smRewriteRhsSep contained "\t\+" skipwhite nextgroup=smRewriteComment,smRewriteRhsSep
|
|
52 syn match smRewriteRhsSep contained "$"
|
|
53
|
|
54 syn match smRewriteComment contained "[^\t$]*$"
|
|
55
|
|
56 " Clauses
|
|
57 syn match smClauseError "\$\."
|
|
58 syn match smElse contained "\$|"
|
|
59 syn match smClauseCont contained "^\t"
|
|
60 syn region smClause matchgroup=Delimiter start="\$?." matchgroup=Delimiter end="\$\." contains=smElse,smClause,smVar,smClauseCont
|
|
61
|
|
62 " Define the default highlighting.
|
|
63 " For version 5.7 and earlier: only when not done already
|
|
64 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
65 if version >= 508 || !exists("did_smil_syntax_inits")
|
|
66 if version < 508
|
|
67 let did_smil_syntax_inits = 1
|
|
68 command -nargs=+ HiLink hi link <args>
|
|
69 else
|
|
70 command -nargs=+ HiLink hi def link <args>
|
|
71 endif
|
|
72
|
|
73 HiLink smClause Special
|
|
74 HiLink smClauseError Error
|
|
75 HiLink smComment Comment
|
|
76 HiLink smDefine Statement
|
|
77 HiLink smElse Delimiter
|
|
78 HiLink smHeader Statement
|
|
79 HiLink smHeaderSep String
|
|
80 HiLink smMesg Special
|
|
81 HiLink smPrecedence Number
|
|
82 HiLink smRewrite Statement
|
|
83 HiLink smRewriteComment Comment
|
|
84 HiLink smRewriteLhsToken String
|
|
85 HiLink smRewriteLhsUser Statement
|
|
86 HiLink smRewriteRhsToken String
|
|
87 HiLink smRuleset Preproc
|
|
88 HiLink smTrusted Special
|
|
89 HiLink smVar String
|
|
90
|
|
91 delcommand HiLink
|
|
92 endif
|
|
93
|
|
94 let b:current_syntax = "sm"
|
|
95
|
|
96 " vim: ts=18
|