3 " Maintainer: Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
4 " Last Change: Sep 06, 2005
6 " URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax
8 " For version 5.x: Clear all syntax items
9 " For version 6.x: Quit when a syntax file was already loaded
12 elseif exists("b:current_syntax")
17 syn match smComment "^#.*$" contains=@Spell
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
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
35 syn match smVar "\$[a-z\.\|]"
38 syn match smRuleset "^S\d*"
41 syn match smRewrite "^R" skipwhite nextgroup=smRewriteLhsToken,smRewriteLhsUser
43 syn match smRewriteLhsUser contained "[^\t$]\+" skipwhite nextgroup=smRewriteLhsToken,smRewriteLhsSep
44 syn match smRewriteLhsToken contained "\(\$[-*+]\|\$[-=][A-Za-z]\|\$Y\)\+" skipwhite nextgroup=smRewriteLhsUser,smRewriteLhsSep
46 syn match smRewriteLhsSep contained "\t\+" skipwhite nextgroup=smRewriteRhsToken,smRewriteRhsUser
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
51 syn match smRewriteRhsSep contained "\t\+" skipwhite nextgroup=smRewriteComment,smRewriteRhsSep
52 syn match smRewriteRhsSep contained "$"
54 syn match smRewriteComment contained "[^\t$]*$"
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
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")
67 let did_smil_syntax_inits = 1
68 command -nargs=+ HiLink hi link <args>
70 command -nargs=+ HiLink hi def link <args>
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
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
94 let b:current_syntax = "sm"