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
7 " Filenames: /tmp/crontab.* used by "crontab -e"
8 " URL: http://trific.ath.cx/Ftp/vim/syntax/crontab.vim
9 " Last Change: 2006-04-20
11 " crontab line format:
12 " Minutes Hours Days Months Days_of_Week Commands # comments
14 " For version 5.x: Clear all syntax items
15 " For version 6.x: Quit when a syntax file was already loaded
18 elseif exists("b:current_syntax")
22 syntax match crontabMin "^\s*[-0-9/,.*]\+" nextgroup=crontabHr skipwhite
23 syntax match crontabHr "\s[-0-9/,.*]\+" nextgroup=crontabDay skipwhite contained
24 syntax match crontabDay "\s[-0-9/,.*]\+" nextgroup=crontabMnth skipwhite contained
26 syntax match crontabMnth "\s[-a-z0-9/,.*]\+" nextgroup=crontabDow skipwhite contained
27 syntax keyword crontabMnth12 contained jan feb mar apr may jun jul aug sep oct nov dec
29 syntax match crontabDow "\s[-a-z0-9/,.*]\+" nextgroup=crontabCmd skipwhite contained
30 syntax keyword crontabDow7 contained sun mon tue wed thu fri sat
32 syntax region crontabCmd start="\S" end="$" skipwhite contained keepend contains=crontabPercent
33 syntax match crontabCmnt "^\s*#.*"
34 syntax match crontabPercent "[^\\]%.*"lc=1 contained
36 syntax match crontabNick "^\s*@\(reboot\|yearly\|annually\|monthly\|weekly\|daily\|midnight\|hourly\)\>" nextgroup=crontabCmd skipwhite
38 syntax match crontabVar "^\s*\k\w*\s*="me=e-1
40 " Define the default highlighting.
41 " For version 5.7 and earlier: only when not done already
42 " For version 5.8 and later: only when an item doesn't have highlighting yet
43 if version >= 508 || !exists("did_crontab_syn_inits")
45 let did_crontab_syn_inits = 1
46 command -nargs=+ HiLink hi link <args>
48 command -nargs=+ HiLink hi def link <args>
51 HiLink crontabMin Number
52 HiLink crontabHr PreProc
53 HiLink crontabDay Type
55 HiLink crontabMnth Number
56 HiLink crontabMnth12 Number
57 HiLink crontabMnthS Number
58 HiLink crontabMnthN Number
60 HiLink crontabDow PreProc
61 HiLink crontabDow7 PreProc
62 HiLink crontabDowS PreProc
63 HiLink crontabDowN PreProc
65 HiLink crontabNick Special
66 HiLink crontabVar Identifier
67 HiLink crontabPercent Special
69 " comment out next line for to suppress unix commands coloring.
70 HiLink crontabCmd Statement
72 HiLink crontabCmnt Comment
77 let b:current_syntax = "crontab"