Merge branch 'hack/autopaste'
[vim-kana.git] / runtime / syntax / sm.vim
blob2f9e6d7d01930efcaa8d910d84ab12762b5c7593
1 " Vim syntax file
2 " Language:     sendmail
3 " Maintainer:   Dr. Charles E. Campbell, Jr. <NdrOchipS@PcampbellAfamily.Mbiz>
4 " Last Change:  Sep 06, 2005
5 " Version:      4
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
10 if version < 600
11   syntax clear
12 elseif exists("b:current_syntax")
13   finish
14 endif
16 " Comments
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
34 " Variables
35 syn match smVar         "\$[a-z\.\|]"
37 " Rulesets
38 syn match smRuleset     "^S\d*"
40 " Rewriting Rules
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$]*$"
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
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
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
91   delcommand HiLink
92 endif
94 let b:current_syntax = "sm"
96 " vim: ts=18