comparison runtime/syntax/crontab.vim @ 0:76efa0be13f1

Initial revision
author atsuki
date Sat, 10 Nov 2007 15:07:22 +0900
parents
children 67300faee616
comparison
equal deleted inserted replaced
-1:000000000000 0:76efa0be13f1
1 " Vim syntax file
2 " Language: crontab
3 " Maintainer: David Necas (Yeti) <yeti@physics.muni.cz>
4 " Original Maintainer: John Hoelzel johnh51@users.sourceforge.net
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 " URL: http://trific.ath.cx/Ftp/vim/syntax/crontab.vim
9 " Last Change: 2006-04-20
10 "
11 " crontab line format:
12 " Minutes Hours Days Months Days_of_Week Commands # comments
13
14 " For version 5.x: Clear all syntax items
15 " For version 6.x: Quit when a syntax file was already loaded
16 if version < 600
17 syntax clear
18 elseif exists("b:current_syntax")
19 finish
20 endif
21
22 syntax match crontabMin "^\s*[-0-9/,.*]\+" nextgroup=crontabHr skipwhite
23 syntax match crontabHr "\s[-0-9/,.*]\+" nextgroup=crontabDay skipwhite contained
24 syntax match crontabDay "\s[-0-9/,.*]\+" nextgroup=crontabMnth skipwhite contained
25
26 syntax match crontabMnth "\s[-a-z0-9/,.*]\+" nextgroup=crontabDow skipwhite contained
27 syntax keyword crontabMnth12 contained jan feb mar apr may jun jul aug sep oct nov dec
28
29 syntax match crontabDow "\s[-a-z0-9/,.*]\+" nextgroup=crontabCmd skipwhite contained
30 syntax keyword crontabDow7 contained sun mon tue wed thu fri sat
31
32 syntax region crontabCmd start="\S" end="$" skipwhite contained keepend contains=crontabPercent
33 syntax match crontabCmnt "^\s*#.*"
34 syntax match crontabPercent "[^\\]%.*"lc=1 contained
35
36 syntax match crontabNick "^\s*@\(reboot\|yearly\|annually\|monthly\|weekly\|daily\|midnight\|hourly\)\>" nextgroup=crontabCmd skipwhite
37
38 syntax match crontabVar "^\s*\k\w*\s*="me=e-1
39
40 " Define the default highlighting.
41 " For version 5.7 and earlier: only when not done already
42 " For version 5.8 and later: only when an item doesn't have highlighting yet
43 if version >= 508 || !exists("did_crontab_syn_inits")
44 if version < 508
45 let did_crontab_syn_inits = 1
46 command -nargs=+ HiLink hi link <args>
47 else
48 command -nargs=+ HiLink hi def link <args>
49 endif
50
51 HiLink crontabMin Number
52 HiLink crontabHr PreProc
53 HiLink crontabDay Type
54
55 HiLink crontabMnth Number
56 HiLink crontabMnth12 Number
57 HiLink crontabMnthS Number
58 HiLink crontabMnthN Number
59
60 HiLink crontabDow PreProc
61 HiLink crontabDow7 PreProc
62 HiLink crontabDowS PreProc
63 HiLink crontabDowN PreProc
64
65 HiLink crontabNick Special
66 HiLink crontabVar Identifier
67 HiLink crontabPercent Special
68
69 " comment out next line for to suppress unix commands coloring.
70 HiLink crontabCmd Statement
71
72 HiLink crontabCmnt Comment
73
74 delcommand HiLink
75 endif
76
77 let b:current_syntax = "crontab"
78
79 " vim: ts=8