2 " Language: Mailcap configuration file
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 " For version 5.x: Clear all syntax items
8 " For version 6.x: Quit when a syntax file was already loaded
11 elseif exists("b:current_syntax")
15 syn match mailcapComment "^#.*"
17 syn region mailcapString start=+"+ end=+"+ contains=mailcapSpecial oneline
19 syn match mailcapDelimiter "\\\@<!;"
21 syn match mailcapSpecial "\\\@<!%[nstF]"
22 syn match mailcapSpecial "\\\@<!%{[^}]*}"
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*;"
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")
35 let did_mailcap_syntax_inits = 1
36 command -nargs=+ HiLink hi link <args>
38 command -nargs=+ HiLink hi def link <args>
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
52 let b:current_syntax = "mailcap"