7
|
1 " Vim syntax file
|
838
|
2 " Language: crontab
|
|
3 " Maintainer: David Necas (Yeti) <yeti@physics.muni.cz>
|
|
4 " Original Maintainer: John Hoelzel johnh51@users.sourceforge.net
|
|
5 " License: This file can be redistribued and/or modified under the same terms
|
|
6 " as Vim itself.
|
|
7 " Filenames: /tmp/crontab.* used by "crontab -e"
|
6530
|
8 " Last Change: 2015-01-20
|
7
|
9 "
|
|
10 " crontab line format:
|
|
11 " Minutes Hours Days Months Days_of_Week Commands # comments
|
|
12
|
|
13 " For version 5.x: Clear all syntax items
|
|
14 " For version 6.x: Quit when a syntax file was already loaded
|
|
15 if version < 600
|
6530
|
16 syntax clear
|
7
|
17 elseif exists("b:current_syntax")
|
6530
|
18 finish
|
7
|
19 endif
|
|
20
|
6530
|
21 syntax match crontabNick "^\s*@\(reboot\|yearly\|annually\|monthly\|weekly\|daily\|midnight\|hourly\)\>" nextgroup=crontabCmd skipwhite
|
|
22
|
|
23 syntax match crontabVar "^\s*\k\w*\s*="me=e-1
|
|
24
|
|
25 syntax case ignore
|
|
26
|
838
|
27 syntax match crontabMin "^\s*[-0-9/,.*]\+" nextgroup=crontabHr skipwhite
|
|
28 syntax match crontabHr "\s[-0-9/,.*]\+" nextgroup=crontabDay skipwhite contained
|
|
29 syntax match crontabDay "\s[-0-9/,.*]\+" nextgroup=crontabMnth skipwhite contained
|
7
|
30
|
838
|
31 syntax match crontabMnth "\s[-a-z0-9/,.*]\+" nextgroup=crontabDow skipwhite contained
|
|
32 syntax keyword crontabMnth12 contained jan feb mar apr may jun jul aug sep oct nov dec
|
7
|
33
|
838
|
34 syntax match crontabDow "\s[-a-z0-9/,.*]\+" nextgroup=crontabCmd skipwhite contained
|
|
35 syntax keyword crontabDow7 contained sun mon tue wed thu fri sat
|
7
|
36
|
838
|
37 syntax region crontabCmd start="\S" end="$" skipwhite contained keepend contains=crontabPercent
|
3513
|
38 syntax match crontabCmnt "^\s*#.*" contains=@Spell
|
838
|
39 syntax match crontabPercent "[^\\]%.*"lc=1 contained
|
268
|
40
|
7
|
41 " Define the default highlighting.
|
|
42 " For version 5.7 and earlier: only when not done already
|
|
43 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
44 if version >= 508 || !exists("did_crontab_syn_inits")
|
6530
|
45 if version < 508
|
|
46 let did_crontab_syn_inits = 1
|
|
47 command -nargs=+ HiLink hi link <args>
|
|
48 else
|
|
49 command -nargs=+ HiLink hi def link <args>
|
|
50 endif
|
7
|
51
|
6530
|
52 HiLink crontabMin Number
|
|
53 HiLink crontabHr PreProc
|
|
54 HiLink crontabDay Type
|
7
|
55
|
6530
|
56 HiLink crontabMnth Number
|
|
57 HiLink crontabMnth12 Number
|
|
58 HiLink crontabMnthS Number
|
|
59 HiLink crontabMnthN Number
|
7
|
60
|
6530
|
61 HiLink crontabDow PreProc
|
|
62 HiLink crontabDow7 PreProc
|
|
63 HiLink crontabDowS PreProc
|
|
64 HiLink crontabDowN PreProc
|
7
|
65
|
6530
|
66 HiLink crontabNick Special
|
|
67 HiLink crontabVar Identifier
|
|
68 HiLink crontabPercent Special
|
268
|
69
|
7
|
70 " comment out next line for to suppress unix commands coloring.
|
6530
|
71 HiLink crontabCmd Statement
|
7
|
72
|
6530
|
73 HiLink crontabCmnt Comment
|
7
|
74
|
6530
|
75 delcommand HiLink
|
7
|
76 endif
|
|
77
|
|
78 let b:current_syntax = "crontab"
|
|
79
|
|
80 " vim: ts=8
|