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