runtime(sh): highlight single-dash short options containing digits

fixes: #19082

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2026-01-15 21:01:43 +00:00
parent 6aaf005c04
commit 16c2279062
3 changed files with 32 additions and 1 deletions

View File

@@ -19,6 +19,7 @@
" 2025 Jul 18 properly delete :commands #17785
" 2025 Aug 23 bash: add support for ${ cmd;} and ${|cmd;} #18084
" 2025 Sep 23 simplify ksh logic, update sh statements #18355
" 2026 Jan 15 highlight command switches that contain a digit
" }}}
" Version: 208
" Former URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
@@ -345,7 +346,7 @@ endif
" Options: {{{1
" ====================
syn match shOption "\s\zs[-+][-_a-zA-Z#@]\+"
syn match shOption "\s\zs[-+][-_a-zA-Z#@0-9]\+"
syn match shOption "\s\zs--[^ \t$=`'"|);]\+"
" File Redirection Highlighted As Operators: {{{1

View File

@@ -0,0 +1,20 @@
>c+0&#ffffff0|u|r|l| |-+0#e000e06&@1|h|t@1|p|2| +0#0000000&|-+0#e000e06&@1|t|l|s|v|1|.|2| +0#0000000&|-+0#e000e06&|O| +0#0000000&|h|t@1|p|s|:|/@1|e|x|a|m|p|l|e|.|c|o|m|/|f|i|l|e|.|t|x|t| @20
|w|g|e|t| |-+0#e000e06&@1|i|n|e|t|6|-|o|n|l|y| +0#0000000&|h|t@1|p|s|:|/@1|e|x|a|m|p|l|e|.|c|o|m|/|f|i|l|e|.|t|x|t| @28
|g|z|i|p| |-+0#e000002&|9| +0#0000000&|f|i|l|e| @62
|x|z| |-+0#e000e06&|T|0| +0#0000000&|f|i|l|e| @63
|f+0#af5f00255&|i|n|d| +0#0000000&|/|t|m|p| |-+0#e000e06&|t|y|p|e| +0#0000000&|f| |-+0#e000e06&|p|r|i|n|t|0| +0#0000000&||| |x+0#af5f00255&|a|r|g|s| +0#0000000&|-+0#e000002&|0| +0#0000000&|e+0#af5f00255&|c|h|o| +0#0000000&@33
|c+0#af5f00255&|u|t| +0#0000000&|-+0#e000e06&|f|1| +0#0000000&|f|i|l|e| @62
|n+0#af5f00255&|i|c|e| +0#0000000&|-+0#e000e06&|n|1|0| +0#0000000&|m|a|k|e| |-+0#e000e06&|j|4| +0#0000000&@56
|k+0#af5f00255&|i|l@1| +0#0000000&|-+0#e000002&|9| +0#0000000&|1+0#e000002&|2|3|4|5| +0#0000000&@61
|t+0#af5f00255&|a|i|l| +0#0000000&|-+0#e000e06&|n|1|0| +0#0000000&|e|r@1|o|r|.|l|o|g| @55
|g|i|t| |l|o|g| |-+0#e000e06&|n|1|0| +0#0000000&@62
|~+0#4040ff13&| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|i+0#0000000&|s|_|d|a|s|h|:| |1|,| |i|s|_|p|o|s|i|x|:| |1|,| |i|s|_|s|h|:| |1|,| @22|1|,|1| @10|A|l@1|

View File

@@ -0,0 +1,10 @@
curl --http2 --tlsv1.2 -O https://example.com/file.txt
wget --inet6-only https://example.com/file.txt
gzip -9 file
xz -T0 file
find /tmp -type f -print0 | xargs -0 echo
cut -f1 file
nice -n10 make -j4
kill -9 12345
tail -n10 error.log
git log -n10