blob: 2923f446b1aa22fec34e59d1dbb188881a8102ec [file] [log] [blame]
Bram Moolenaar293ee4d2004-12-09 21:34:53 +00001" Vim syntax file
2" Maintainer: Nikolai Weibull <source@pcppopper.org>
3" URL: http://www.pcppopper.org/
4" Latest Revision: 2004-11-11
5" arch-tag: 356fad6d-ff6b-453c-bd25-7fc63c4758bc
6
7if version < 600
8 syntax clear
9elseif exists("b:current_syntax")
10 finish
11endif
12
13" Todo
14syn keyword sieveTodo contained TODO FIXME XXX NOTE
15
16" Comments
17syn region sieveComment matchgroup=sieveComment start='/\*' end='\*/' contains=sieveTodo
18syn region sieveComment matchgroup=sieveComment start='#' end='$' contains=sieveTodo
19
20syn case ignore
21
22" Tags
23syn match sieveTag ':\h\w*'
24
25" Numbers
26syn match sieveNumber '\d\+[KMG]\='
27
28" Specials
29syn match sieveSpecial '\\["\\]'
30
31" Strings
32syn region sieveString matchgroup=sieveString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=sieveSpecial
33syn region sieveString matchgroup=sieveString start='text:' end='\n.\n'
34
35" Keywords
36syn keyword sieveConditional if elsif else
37syn keyword sieveTest address allof anyof envelope exists false header not size true
38syn keyword sievePreProc require stop
39syn keyword sieveAction reject fileinto redirect keep discard
40syn match sieveKeyword '\<\h\w*\>'
41
42" Define the default highlighting.
43" For version 5.7 and earlier: only when not done already
44" For version 5.8 and later: only when an item doesn't have highlighting yet
45if version >= 508 || !exists("did_sieve_syn_inits")
46 if version < 508
47 let did_sieve_syn_inits = 1
48 command -nargs=+ HiLink hi link <args>
49 else
50 command -nargs=+ HiLink hi def link <args>
51 endif
52
53 HiLink sieveTodo Todo
54 HiLink sieveComment Comment
55 HiLink sieveTag Type
56 HiLink sieveNumber Number
57 HiLink sieveSpecial Special
58 HiLink sieveString String
59 HiLink sieveConditional Conditional
60 HiLink sieveTest Keyword
61 HiLink sievePreProc PreProc
62 HiLink sieveAction Keyword
63 HiLink sieveKeyword Keyword
64
65 delcommand HiLink
66endif
67
68let b:current_syntax = "sieve"
69
70" vim: set sts=2 sw=2: