comparison runtime/syntax/crontab.vim @ 7:3fc0f57ecb91 v7.0001

updated for version 7.0001
author vimboss
date Sun, 13 Jun 2004 20:20:40 +0000
parents
children 8e3c690f1f3c
comparison
equal deleted inserted replaced
6:c2daee826b8f 7:3fc0f57ecb91
1 " Vim syntax file
2 " Language: crontab 2.3.3
3 " Maintainer: John Hoelzel johnh51@users.sourceforge.net
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
13 if version < 600
14 syntax clear
15 elseif exists("b:current_syntax")
16 finish
17 endif
18
19 syntax match crontabMin "\_^[0-9\-\/\,\.]\{}\>\|\*" nextgroup=crontabHr skipwhite
20 syntax match crontabHr "\<[0-9\-\/\,\.]\{}\>\|\*" nextgroup=crontabDay skipwhite contained
21 syntax match crontabDay "\<[0-9\-\/\,\.]\{}\>\|\*" nextgroup=crontabMnth skipwhite contained
22
23 syntax match crontabMnth "\<[a-z0-9\-\/\,\.]\{}\>\|\*" nextgroup=crontabDow skipwhite contained
24 syntax keyword crontabMnth12 contained jan feb mar apr may jun jul aug sep oct nov dec
25
26 syntax match crontabDow "\<[a-z0-9\-\/\,\.]\{}\>\|\*" nextgroup=crontabCmd skipwhite contained
27 syntax 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
31 syntax region crontabCmd start="\S" end="$" nextgroup=crontabCmnt skipwhite contained contains=crontabCmnt keepend
32 syntax 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
37 if 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
65 endif
66
67 let b:current_syntax = "crontab"
68
69 " vim: ts=8