1" Vim syntax file 2" Language: crontab 2.3.3 3" Maintainer: John Hoelzel [email protected] 4" Last change: Mon Jun 9 2003 5" Filenames: /tmp/crontab.* used by "crontab -e" 6" URL: http://johnh51.get.to/vim/syntax/crontab.vim 7" 8" crontab line format: 9" Minutes Hours Days Months Days_of_Week Commands # comments 10 11" For version 5.x: Clear all syntax items 12" For version 6.x: Quit when a syntax file was already loaded 13if version < 600 14 syntax clear 15elseif exists("b:current_syntax") 16 finish 17endif 18 19syntax match crontabMin "\_^[0-9\-\/\,\.]\{}\>\|\*" nextgroup=crontabHr skipwhite 20syntax match crontabHr "\<[0-9\-\/\,\.]\{}\>\|\*" nextgroup=crontabDay skipwhite contained 21syntax match crontabDay "\<[0-9\-\/\,\.]\{}\>\|\*" nextgroup=crontabMnth skipwhite contained 22 23syntax match crontabMnth "\<[a-z0-9\-\/\,\.]\{}\>\|\*" nextgroup=crontabDow skipwhite contained 24syntax keyword crontabMnth12 contained jan feb mar apr may jun jul aug sep oct nov dec 25 26syntax match crontabDow "\<[a-z0-9\-\/\,\.]\{}\>\|\*" nextgroup=crontabCmd skipwhite contained 27syntax keyword crontabDow7 contained sun mon tue wed thu fri sat 28 29" syntax region crontabCmd start="\<[a-z0-9\/\(]" end="$" nextgroup=crontabCmnt skipwhite contained contains=crontabCmnt keepend 30 31syntax region crontabCmd start="\S" end="$" nextgroup=crontabCmnt skipwhite contained contains=crontabCmnt keepend 32syntax match crontabCmnt /#.*/ 33 34" Define the default highlighting. 35" For version 5.7 and earlier: only when not done already 36" For version 5.8 and later: only when an item doesn't have highlighting yet 37if version >= 508 || !exists("did_crontab_syn_inits") 38 if version < 508 39 let did_crontab_syn_inits = 1 40 command -nargs=+ HiLink hi link <args> 41 else 42 command -nargs=+ HiLink hi def link <args> 43 endif 44 45 HiLink crontabMin Number 46 HiLink crontabHr PreProc 47 HiLink crontabDay Type 48 49 HiLink crontabMnth Number 50 HiLink crontabMnth12 Number 51 HiLink crontabMnthS Number 52 HiLink crontabMnthN Number 53 54 HiLink crontabDow PreProc 55 HiLink crontabDow7 PreProc 56 HiLink crontabDowS PreProc 57 HiLink crontabDowN PreProc 58 59" comment out next line for to suppress unix commands coloring. 60 HiLink crontabCmd Type 61 62 HiLink crontabCmnt Comment 63 64 delcommand HiLink 65endif 66 67let b:current_syntax = "crontab" 68 69" vim: ts=8 70