7
|
1 " Vim syntax file
|
|
2 " Language: calendar(1) file.
|
|
3 " Maintainer: Nikolai Weibull <source@pcppopper.org>
|
|
4 " URL: http://www.pcppopper.org/vim/syntax/pcp/calendar/
|
|
5 " Latest Revision: 2004-05-06
|
|
6 " arch-tag: d714127d-469d-43bd-9c79-c2a46ec54535
|
|
7
|
|
8 if version < 600
|
|
9 syntax clear
|
|
10 elseif exists("b:current_syntax")
|
|
11 finish
|
|
12 endif
|
|
13
|
|
14 " Todo
|
|
15 syn keyword calendarTodo contained TODO FIXME XXX NOTE
|
|
16
|
|
17 " Comments
|
|
18 syn region calendarComment matchgroup=calendarComment start='/\*' end='\*/' contains=calendarTodo
|
|
19
|
|
20 " Strings
|
|
21 syn region calendarCppString start=+L\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=calendarSpecial
|
|
22 syn match calendarSpecial display contained '\\\%(x\x\+\|\o\{1,3}\|.\|$\)'
|
|
23 syn match calendarSpecial display contained "\\\(u\x\{4}\|U\x\{8}\)"
|
|
24
|
|
25 " cpp(1) Preprocessor directives (adapted from syntax/c.vim)
|
|
26
|
|
27 syn region calendarPreCondit start='^\s*#\s*\%(if\|ifdef\|ifndef\|elif\)\>' skip='\\$' end='$' contains=calendarComment,calendarCppString
|
|
28 syn match calendarPreCondit display '^\s*#\s*\%(else\|endif\)\>'
|
|
29 syn region calendarCppOut start='^\s*#\s*if\s\+0\+' end='.\@=\|$' contains=calendarCppOut2
|
|
30 syn region calendarCppOut2 contained start='0' end='^\s*#\s*\%(endif\|else\|elif\)\>' contains=calendarSpaceError,calendarCppSkip
|
|
31 syn region calendarCppSkip contained start='^\s*#\s*\%(if\|ifdef\|ifndef\)\>' skip='\\$' end='^\s*#\s*endif\>' contains=calendarSpaceError,calendarCppSkip
|
|
32 syn region calendarIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
|
|
33 syn match calendarIncluded display contained '<[^>]*>'
|
|
34 syn match calendarInclude display '^\s*#\s*include\>\s*["<]' contains=calendarIncluded
|
|
35 syn cluster calendarPreProcGroup contains=calendarPreCondit,calendarIncluded,calendarInclude,calendarDefine,calendarCppOut,calendarCppOut2,calendarCppSkip,calendarString,calendarSpecial,calendarTodo
|
|
36 syn region calendarDefine start='^\s*#\s*\%(define\|undef\)\>' skip='\\$' end='$' contains=ALLBUT,@calendarPreProcGroup
|
|
37 syn region calendarPreProc start='^\s*#\s*\%(pragma\|line\|warning\|warn\|error\)\>' skip='\\$' end='$' keepend contains=ALLBUT,@calendarPreProcGroup
|
|
38
|
|
39 " Keywords
|
|
40 syn keyword calendarKeyword CHARSET BODUN LANG
|
|
41 syn case ignore
|
|
42 syn keyword calendarKeyword Easter Pashka
|
|
43 syn case match
|
|
44
|
|
45 " Dates
|
|
46 syn case ignore
|
|
47 syn match calendarNumber '\<\d\+\>'
|
|
48 syn keyword calendarMonth Jan[uary] Feb[ruary] Mar[ch] Apr[il] May Jun[e]
|
|
49 syn keyword calendarMonth Jul[y] Aug[ust] Sep[tember] Oct[ober]
|
|
50 syn keyword calendarMonth Nov[ember] Dec[ember]
|
|
51 syn match calendarMonth '\<\%(Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|Sep\|Oct\|Nov\|Dec\)\.'
|
|
52 syn keyword calendarWeekday Mon[day] Tue[sday] Wed[nesday] Thu[rsday]
|
|
53 syn keyword calendarWeekday Fri[day] Sat[urday] Sun[day]
|
|
54 syn match calendarWeekday '\<\%(Mon\|Tue\|Wed\|Thu\|Fri\|Sat\|Sun\)\.' nextgroup=calendarWeekdayMod
|
|
55 syn match calendarWeekdayMod '[+-]\d\+\>'
|
|
56 syn case match
|
|
57
|
|
58 " Times
|
|
59 syn match calendarTime '\<\%([01]\=\d\|2[0-3]\):[0-5]\d\%(:[0-5]\d\)\='
|
|
60 syn match calendarTime '\<\%(0\=[1-9]\|1[0-2]\):[0-5]\d\%(:[0-5]\d\)\=\s*[AaPp][Mm]'
|
|
61
|
|
62 " Variables
|
|
63 syn match calendarVariable '\*'
|
|
64
|
|
65 let b:c_minlines = 50 " #if 0 constructs can be long
|
|
66 exec "syn sync ccomment calendarComment minlines=" . b:c_minlines
|
|
67
|
|
68 " Define the default highlighting.
|
|
69 " For version 5.7 and earlier: only when not done already
|
|
70 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
71 if version >= 508 || !exists("did_calendar_syn_inits")
|
|
72 if version < 508
|
|
73 let did_calendar_syn_inits = 1
|
|
74 command -nargs=+ HiLink hi link <args>
|
|
75 else
|
|
76 command -nargs=+ HiLink hi def link <args>
|
|
77 endif
|
|
78
|
|
79 HiLink calendarTodo Todo
|
|
80 HiLink calendarComment Comment
|
|
81 HiLink calendarCppString String
|
|
82 HiLink calendarSpecial SpecialChar
|
|
83 HiLink calendarPreCondit PreCondit
|
|
84 HiLink calendarCppOut Comment
|
|
85 HiLink calendarCppOut2 calendarCppOut
|
|
86 HiLink calendarCppSkip calendarCppOut
|
|
87 HiLink calendarIncluded String
|
|
88 HiLink calendarInclude Include
|
|
89 HiLink calendarDefine Macro
|
|
90 HiLink calendarPreProc PreProc
|
|
91 HiLink calendarKeyword Keyword
|
|
92 HiLink calendarNumber Number
|
|
93 HiLink calendarMonth String
|
|
94 HiLink calendarWeekday String
|
|
95 HiLink calendarWeekdayMod Special
|
|
96 HiLink calendarTime Number
|
|
97 HiLink calendarVariable Identifier
|
|
98
|
|
99 delcommand HiLink
|
|
100 endif
|
|
101
|
|
102 let b:current_syntax = "calendar"
|
|
103
|
|
104 " vim: set sts=2 sw=2:
|