vim-patch:cdd934439d08

runtime(crontab): add support for BSD specifics in syntax script (vim/vim#11196)

* OpenBSD supports the use of `~` as alias for "random valid value"
* FreeBSD supports `@every_{minute,second}`

See:

* https://man.openbsd.org/crontab.5
* https://www.freebsd.org/cgi/man.cgi?query=crontab&sektion=5

cdd934439d

Co-authored-by: Moviuro <moviuro@users.noreply.github.com>
This commit is contained in:
Christian Clason
2023-08-23 10:10:25 +09:00
parent 4ca8b90b14
commit 9ab5fda99e

View File

@ -5,7 +5,7 @@
" License: This file can be redistribued and/or modified under the same terms " License: This file can be redistribued and/or modified under the same terms
" as Vim itself. " as Vim itself.
" Filenames: /tmp/crontab.* used by "crontab -e" " Filenames: /tmp/crontab.* used by "crontab -e"
" Last Change: 2015-01-20 " Last Change: 2022-09-22
" "
" crontab line format: " crontab line format:
" Minutes Hours Days Months Days_of_Week Commands # comments " Minutes Hours Days Months Days_of_Week Commands # comments
@ -15,20 +15,20 @@ if exists("b:current_syntax")
finish finish
endif endif
syntax match crontabNick "^\s*@\(reboot\|yearly\|annually\|monthly\|weekly\|daily\|midnight\|hourly\)\>" nextgroup=crontabCmd skipwhite syntax match crontabNick "^\s*@\(reboot\|yearly\|annually\|monthly\|weekly\|daily\|midnight\|hourly\|every_minute\|every_second\)\>" nextgroup=crontabCmd skipwhite
syntax match crontabVar "^\s*\k\w*\s*="me=e-1 syntax match crontabVar "^\s*\k\w*\s*="me=e-1
syntax case ignore syntax case ignore
syntax match crontabMin "^\s*[-0-9/,.*]\+" nextgroup=crontabHr skipwhite syntax match crontabMin "^\s*[-~0-9/,.*]\+" nextgroup=crontabHr skipwhite
syntax match crontabHr "\s[-0-9/,.*]\+" nextgroup=crontabDay skipwhite contained syntax match crontabHr "\s[-~0-9/,.*]\+" nextgroup=crontabDay skipwhite contained
syntax match crontabDay "\s[-0-9/,.*]\+" nextgroup=crontabMnth skipwhite contained syntax match crontabDay "\s[-~0-9/,.*]\+" nextgroup=crontabMnth skipwhite contained
syntax match crontabMnth "\s[-a-z0-9/,.*]\+" nextgroup=crontabDow skipwhite contained syntax match crontabMnth "\s[-~a-z0-9/,.*]\+" nextgroup=crontabDow skipwhite contained
syntax keyword crontabMnth12 contained jan feb mar apr may jun jul aug sep oct nov dec syntax keyword crontabMnth12 contained jan feb mar apr may jun jul aug sep oct nov dec
syntax match crontabDow "\s[-a-z0-9/,.*]\+" nextgroup=crontabCmd skipwhite contained syntax match crontabDow "\s[-~a-z0-9/,.*]\+" nextgroup=crontabCmd skipwhite contained
syntax keyword crontabDow7 contained sun mon tue wed thu fri sat syntax keyword crontabDow7 contained sun mon tue wed thu fri sat
syntax region crontabCmd start="\S" end="$" skipwhite contained keepend contains=crontabPercent syntax region crontabCmd start="\S" end="$" skipwhite contained keepend contains=crontabPercent