7
|
1 " Vim syntax file
|
375
|
2 " Language: calendar(1) input file
|
839
|
3 " Maintainer: Nikolai Weibull <now@bitwi.se>
|
|
4 " Latest Revision: 2006-04-19
|
7
|
5
|
375
|
6 if exists("b:current_syntax")
|
7
|
7 finish
|
|
8 endif
|
|
9
|
375
|
10 let s:cpo_save = &cpo
|
|
11 set cpo&vim
|
7
|
12
|
375
|
13 syn keyword calendarTodo contained TODO FIXME XXX NOTE
|
7
|
14
|
389
|
15 syn region calendarComment start='/\*' end='\*/'
|
375
|
16 \ contains=calendarTodo,@Spell
|
7
|
17
|
375
|
18 syn region calendarCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl
|
|
19 \ end=+"+ end='$' contains=calendarSpecial
|
|
20 syn match calendarSpecial display contained '\\\%(x\x\+\|\o\{1,3}\|.\|$\)'
|
|
21 syn match calendarSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)"
|
7
|
22
|
375
|
23 syn region calendarPreCondit start='^\s*#\s*\%(if\|ifdef\|ifndef\|elif\)\>'
|
|
24 \ skip='\\$' end='$'
|
|
25 \ contains=calendarComment,calendarCppString
|
|
26 syn match calendarPreCondit display '^\s*#\s*\%(else\|endif\)\>'
|
|
27 syn region calendarCppOut start='^\s*#\s*if\s\+0\+' end='.\@=\|$'
|
|
28 \ contains=calendarCppOut2
|
|
29 syn region calendarCppOut2 contained start='0'
|
|
30 \ end='^\s*#\s*\%(endif\|else\|elif\)\>'
|
|
31 \ contains=calendarSpaceError,calendarCppSkip
|
|
32 syn region calendarCppSkip contained
|
|
33 \ start='^\s*#\s*\%(if\|ifdef\|ifndef\)\>'
|
|
34 \ skip='\\$' end='^\s*#\s*endif\>'
|
|
35 \ contains=calendarSpaceError,calendarCppSkip
|
|
36 syn region calendarIncluded display contained start=+"+ skip=+\\\\\|\\"+
|
|
37 \ end=+"+
|
|
38 syn match calendarIncluded display contained '<[^>]*>'
|
|
39 syn match calendarInclude display '^\s*#\s*include\>\s*["<]'
|
|
40 \ contains=calendarIncluded
|
|
41 syn cluster calendarPreProcGroup contains=calendarPreCondit,calendarIncluded,
|
|
42 \ calendarInclude,calendarDefine,
|
|
43 \ calendarCppOut,calendarCppOut2,
|
|
44 \ calendarCppSkip,calendarString,
|
|
45 \ calendarSpecial,calendarTodo
|
|
46 syn region calendarDefine start='^\s*#\s*\%(define\|undef\)\>'
|
|
47 \ skip='\\$' end='$'
|
|
48 \ contains=ALLBUT,@calendarPreProcGroup
|
|
49 syn region calendarPreProc start='^\s*#\s*\%(pragma\|line\|warning\|warn\|error\)\>'
|
|
50 \ skip='\\$' end='$' keepend
|
|
51 \ contains=ALLBUT,@calendarPreProcGroup
|
7
|
52
|
375
|
53 syn keyword calendarKeyword CHARSET BODUN LANG
|
7
|
54 syn case ignore
|
375
|
55 syn keyword calendarKeyword Easter Pashka
|
7
|
56 syn case match
|
|
57
|
375
|
58 syn case ignore
|
|
59 syn match calendarNumber display '\<\d\+\>'
|
|
60 syn keyword calendarMonth Jan[uary] Feb[ruary] Mar[ch] Apr[il] May
|
|
61 \ Jun[e] Jul[y] Aug[ust] Sep[tember]
|
|
62 \ Oct[ober] Nov[ember] Dec[ember]
|
|
63 syn match calendarMonth display '\<\%(Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|Sep\|Oct\|Nov\|Dec\)\.'
|
|
64 syn keyword calendarWeekday Mon[day] Tue[sday] Wed[nesday] Thu[rsday]
|
|
65 syn keyword calendarWeekday Fri[day] Sat[urday] Sun[day]
|
|
66 syn match calendarWeekday display '\<\%(Mon\|Tue\|Wed\|Thu\|Fri\|Sat\|Sun\)\.'
|
|
67 \ nextgroup=calendarWeekdayMod
|
|
68 syn match calendarWeekdayMod display '[+-]\d\+\>'
|
|
69 syn case match
|
7
|
70
|
375
|
71 syn match calendarTime display '\<\%([01]\=\d\|2[0-3]\):[0-5]\d\%(:[0-5]\d\)\='
|
|
72 syn match calendarTime display '\<\%(0\=[1-9]\|1[0-2]\):[0-5]\d\%(:[0-5]\d\)\=\s*[AaPp][Mm]'
|
|
73
|
|
74 syn match calendarVariable '\*'
|
7
|
75
|
375
|
76 if exists("c_minlines")
|
|
77 let b:c_minlines = c_minlines
|
|
78 else
|
|
79 if !exists("c_no_if0")
|
|
80 let b:c_minlines = 50 " #if 0 constructs can be long
|
|
81 else
|
|
82 let b:c_minlines = 15 " mostly for () constructs
|
|
83 endif
|
|
84 endif
|
7
|
85 exec "syn sync ccomment calendarComment minlines=" . b:c_minlines
|
|
86
|
375
|
87 hi def link calendarTodo Todo
|
|
88 hi def link calendarComment Comment
|
|
89 hi def link calendarCppString String
|
|
90 hi def link calendarSpecial SpecialChar
|
|
91 hi def link calendarPreCondit PreCondit
|
|
92 hi def link calendarCppOut Comment
|
|
93 hi def link calendarCppOut2 calendarCppOut
|
|
94 hi def link calendarCppSkip calendarCppOut
|
|
95 hi def link calendarIncluded String
|
|
96 hi def link calendarInclude Include
|
|
97 hi def link calendarDefine Macro
|
|
98 hi def link calendarPreProc PreProc
|
|
99 hi def link calendarKeyword Keyword
|
|
100 hi def link calendarNumber Number
|
|
101 hi def link calendarMonth String
|
|
102 hi def link calendarWeekday String
|
|
103 hi def link calendarWeekdayMod Special
|
|
104 hi def link calendarTime Number
|
|
105 hi def link calendarVariable Identifier
|
7
|
106
|
|
107 let b:current_syntax = "calendar"
|
|
108
|
375
|
109 let &cpo = s:cpo_save
|
|
110 unlet s:cpo_save
|