1" Vim syntax file 2" Language: crontab 3" Maintainer: David Necas (Yeti) <[email protected]> 4" Original Maintainer: John Hoelzel [email protected] 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" 8" Last Change: 2015-01-20 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 15if version < 600 16 syntax clear 17elseif exists("b:current_syntax") 18 finish 19endif 20 21syntax match crontabNick "^\s*@\(reboot\|yearly\|annually\|monthly\|weekly\|daily\|midnight\|hourly\)\>" nextgroup=crontabCmd skipwhite 22 23syntax match crontabVar "^\s*\k\w*\s*="me=e-1 24 25syntax case ignore 26 27syntax match crontabMin "^\s*[-0-9/,.*]\+" nextgroup=crontabHr skipwhite 28syntax match crontabHr "\s[-0-9/,.*]\+" nextgroup=crontabDay skipwhite contained 29syntax match crontabDay "\s[-0-9/,.*]\+" nextgroup=crontabMnth skipwhite contained 30 31syntax match crontabMnth "\s[-a-z0-9/,.*]\+" nextgroup=crontabDow skipwhite contained 32syntax keyword crontabMnth12 contained jan feb mar apr may jun jul aug sep oct nov dec 33 34syntax match crontabDow "\s[-a-z0-9/,.*]\+" nextgroup=crontabCmd skipwhite contained 35syntax keyword crontabDow7 contained sun mon tue wed thu fri sat 36 37syntax region crontabCmd start="\S" end="$" skipwhite contained keepend contains=crontabPercent 38syntax match crontabCmnt "^\s*#.*" contains=@Spell 39syntax match crontabPercent "[^\\]%.*"lc=1 contained 40 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 44if version >= 508 || !exists("did_crontab_syn_inits") 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 51 52 HiLink crontabMin Number 53 HiLink crontabHr PreProc 54 HiLink crontabDay Type 55 56 HiLink crontabMnth Number 57 HiLink crontabMnth12 Number 58 HiLink crontabMnthS Number 59 HiLink crontabMnthN Number 60 61 HiLink crontabDow PreProc 62 HiLink crontabDow7 PreProc 63 HiLink crontabDowS PreProc 64 HiLink crontabDowN PreProc 65 66 HiLink crontabNick Special 67 HiLink crontabVar Identifier 68 HiLink crontabPercent Special 69 70" comment out next line for to suppress unix commands coloring. 71 HiLink crontabCmd Statement 72 73 HiLink crontabCmnt Comment 74 75 delcommand HiLink 76endif 77 78let b:current_syntax = "crontab" 79 80" vim: ts=8 81