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