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"
|
3513
|
8 " Last Change: 2012-05-16
|
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
|
|
16 syntax clear
|
|
17 elseif exists("b:current_syntax")
|
|
18 finish
|
|
19 endif
|
|
20
|
838
|
21 syntax match crontabMin "^\s*[-0-9/,.*]\+" nextgroup=crontabHr skipwhite
|
|
22 syntax match crontabHr "\s[-0-9/,.*]\+" nextgroup=crontabDay skipwhite contained
|
|
23 syntax match crontabDay "\s[-0-9/,.*]\+" nextgroup=crontabMnth skipwhite contained
|
7
|
24
|
838
|
25 syntax match crontabMnth "\s[-a-z0-9/,.*]\+" nextgroup=crontabDow skipwhite contained
|
|
26 syntax keyword crontabMnth12 contained jan feb mar apr may jun jul aug sep oct nov dec
|
7
|
27
|
838
|
28 syntax match crontabDow "\s[-a-z0-9/,.*]\+" nextgroup=crontabCmd skipwhite contained
|
|
29 syntax keyword crontabDow7 contained sun mon tue wed thu fri sat
|
7
|
30
|
838
|
31 syntax region crontabCmd start="\S" end="$" skipwhite contained keepend contains=crontabPercent
|
3513
|
32 syntax match crontabCmnt "^\s*#.*" contains=@Spell
|
838
|
33 syntax match crontabPercent "[^\\]%.*"lc=1 contained
|
268
|
34
|
838
|
35 syntax match crontabNick "^\s*@\(reboot\|yearly\|annually\|monthly\|weekly\|daily\|midnight\|hourly\)\>" nextgroup=crontabCmd skipwhite
|
268
|
36
|
838
|
37 syntax match crontabVar "^\s*\k\w*\s*="me=e-1
|
7
|
38
|
|
39 " Define the default highlighting.
|
|
40 " For version 5.7 and earlier: only when not done already
|
|
41 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
42 if version >= 508 || !exists("did_crontab_syn_inits")
|
|
43 if version < 508
|
|
44 let did_crontab_syn_inits = 1
|
|
45 command -nargs=+ HiLink hi link <args>
|
|
46 else
|
|
47 command -nargs=+ HiLink hi def link <args>
|
|
48 endif
|
|
49
|
|
50 HiLink crontabMin Number
|
|
51 HiLink crontabHr PreProc
|
|
52 HiLink crontabDay Type
|
|
53
|
|
54 HiLink crontabMnth Number
|
|
55 HiLink crontabMnth12 Number
|
|
56 HiLink crontabMnthS Number
|
|
57 HiLink crontabMnthN Number
|
|
58
|
|
59 HiLink crontabDow PreProc
|
|
60 HiLink crontabDow7 PreProc
|
|
61 HiLink crontabDowS PreProc
|
|
62 HiLink crontabDowN PreProc
|
|
63
|
268
|
64 HiLink crontabNick Special
|
|
65 HiLink crontabVar Identifier
|
838
|
66 HiLink crontabPercent Special
|
268
|
67
|
7
|
68 " comment out next line for to suppress unix commands coloring.
|
838
|
69 HiLink crontabCmd Statement
|
7
|
70
|
|
71 HiLink crontabCmnt Comment
|
|
72
|
|
73 delcommand HiLink
|
|
74 endif
|
|
75
|
|
76 let b:current_syntax = "crontab"
|
|
77
|
|
78 " vim: ts=8
|