7
|
1 " Vim syntax file
|
|
2 " Language: Mailcap configuration file
|
36
|
3 " Maintainer: Doug Kearns <djkea2@gus.gscit.monash.edu.au>
|
|
4 " Last Change: 2004 Nov 27
|
|
5 " URL: http://gus.gscit.monash.edu.au/~djkea2/vim/syntax/mailcap.vim
|
7
|
6
|
|
7 " For version 5.x: Clear all syntax items
|
|
8 " For version 6.x: Quit when a syntax file was already loaded
|
|
9 if version < 600
|
|
10 syntax clear
|
|
11 elseif exists("b:current_syntax")
|
|
12 finish
|
|
13 endif
|
|
14
|
|
15 syn match mailcapComment "^#.*"
|
|
16
|
|
17 syn region mailcapString start=+"+ end=+"+ contains=mailcapSpecial oneline
|
|
18
|
|
19 syn match mailcapDelimiter "\\\@<!;"
|
|
20
|
|
21 syn match mailcapSpecial "\\\@<!%[nstF]"
|
|
22 syn match mailcapSpecial "\\\@<!%{[^}]*}"
|
|
23
|
|
24 syn case ignore
|
|
25 syn match mailcapFlag "\(=\s*\)\@<!\<\(needsterminal\|copiousoutput\|x-\w\+\)\>"
|
|
26 syn match mailcapFieldname "\<\(compose\|composetyped\|print\|edit\|test\|x11-bitmap\|nametemplate\|textualnewlines\|description\|x-\w+\)\>\ze\s*="
|
|
27 syn match mailcapTypeField "^\(text\|image\|audio\|video\|application\|message\|multipart\|model\|x-[[:graph:]]\+\)\(/\(\*\|[[:graph:]]\+\)\)\=\ze\s*;"
|
|
28 syn case match
|
|
29
|
|
30 " Define the default highlighting.
|
|
31 " For version 5.7 and earlier: only when not done already
|
|
32 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
33 if version >= 508 || !exists("did_mailcap_syntax_inits")
|
|
34 if version < 508
|
|
35 let did_mailcap_syntax_inits = 1
|
|
36 command -nargs=+ HiLink hi link <args>
|
|
37 else
|
|
38 command -nargs=+ HiLink hi def link <args>
|
|
39 endif
|
|
40
|
|
41 HiLink mailcapComment Comment
|
|
42 HiLink mailcapDelimiter Delimiter
|
|
43 HiLink mailcapFlag Statement
|
|
44 HiLink mailcapFieldname Statement
|
|
45 HiLink mailcapSpecial Identifier
|
|
46 HiLink mailcapTypeField Type
|
|
47 HiLink mailcapString String
|
|
48
|
|
49 delcommand HiLink
|
|
50 endif
|
|
51
|
|
52 let b:current_syntax = "mailcap"
|
|
53
|
|
54 " vim: tabstop=8
|