summaryrefslogtreecommitdiff
path: root/runtime/syntax/mailcap.vim
blob: 6d62707099ef3c93d0e6fde8208bd6a0ec7d6aed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
" Vim syntax file
" Language:	Mailcap configuration file
" Maintainer:	Doug Kearns
" Last Change:	2002 November 24
" URL:		http://mugca.its.monash.edu.au/~djkea2/vim/syntax/mailcap.vim

" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
  syntax clear
elseif exists("b:current_syntax")
  finish
endif

syn match  mailcapComment	"^#.*"

syn region mailcapString	start=+"+ end=+"+ contains=mailcapSpecial oneline

syn match  mailcapDelimiter	"\\\@<!;"

syn match  mailcapSpecial	"\\\@<!%[nstF]"
syn match  mailcapSpecial	"\\\@<!%{[^}]*}"

syn case ignore
syn match  mailcapFlag		"\(=\s*\)\@<!\<\(needsterminal\|copiousoutput\|x-\w\+\)\>"
syn match  mailcapFieldname	"\<\(compose\|composetyped\|print\|edit\|test\|x11-bitmap\|nametemplate\|textualnewlines\|description\|x-\w+\)\>\ze\s*="
syn match  mailcapTypeField	"^\(text\|image\|audio\|video\|application\|message\|multipart\|model\|x-[[:graph:]]\+\)\(/\(\*\|[[:graph:]]\+\)\)\=\ze\s*;"
syn case match

" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_mailcap_syntax_inits")
  if version < 508
    let did_mailcap_syntax_inits = 1
    command -nargs=+ HiLink hi link <args>
  else
    command -nargs=+ HiLink hi def link <args>
  endif

  HiLink mailcapComment		Comment
  HiLink mailcapDelimiter	Delimiter
  HiLink mailcapFlag		Statement
  HiLink mailcapFieldname	Statement
  HiLink mailcapSpecial		Identifier
  HiLink mailcapTypeField	Type
  HiLink mailcapString		String

  delcommand HiLink
endif

let b:current_syntax = "mailcap"

" vim: tabstop=8