1" Vim syntax file 2" Language: crontab 3" Maintainer: John Hoelzel [email protected] 4" Maintainer: David Necas (Yeti) <[email protected]> 5" Last Change: 2005-04-26 6" Filenames: /tmp/crontab.* used by "crontab -e" 7" URL: http://trific.ath.cx/Ftp/vim/syntax/crontab.vim 8" 9" crontab line format: 10" Minutes Hours Days Months Days_of_Week Commands # comments 11 12" For version 5.x: Clear all syntax items 13" For version 6.x: Quit when a syntax file was already loaded 14if version < 600 15 syntax clear 16elseif exists("b:current_syntax") 17 finish 18endif 19 20syntax match crontabMin "^\s*[-0-9/,.*]\+" nextgroup=crontabHr skipwhite 21syntax match crontabHr "\s[-0-9/,.*]\+" nextgroup=crontabDay skipwhite contained 22syntax match crontabDay "\s[-0-9/,.*]\+" nextgroup=crontabMnth skipwhite contained 23 24syntax match crontabMnth "\s[-a-z0-9/,.*]\+" nextgroup=crontabDow skipwhite contained 25syntax keyword crontabMnth12 contained jan feb mar apr may jun jul aug sep oct nov dec 26 27syntax match crontabDow "\s[-a-z0-9/,.*]\+" nextgroup=crontabCmd skipwhite contained 28syntax keyword crontabDow7 contained sun mon tue wed thu fri sat 29 30" syntax region crontabCmd start="\<[a-z0-9\/\(]" end="$" nextgroup=crontabCmnt skipwhite contained contains=crontabCmnt keepend 31 32syntax region crontabCmd start="\S" end="$" nextgroup=crontabCmnt skipwhite contained keepend 33syntax match crontabCmnt "^\s*#.*" 34 35syntax match crontabNick "^\s*@\(reboot\|yearly\|annually\|monthly\|weekly\|daily\|midnight\|hourly\)\>" nextgroup=crontabCmd skipwhite 36 37syntax match crontabVar "^\s*\k\w*\s*="me=e-1 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 42if 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 64 HiLink crontabNick Special 65 HiLink crontabVar Identifier 66 67" comment out next line for to suppress unix commands coloring. 68 HiLink crontabCmd Type 69 70 HiLink crontabCmnt Comment 71 72 delcommand HiLink 73endif 74 75let b:current_syntax = "crontab" 76 77" vim: ts=8 78