vim-patch:6ba83ba9ee29 (#18948)

Update runtime files.
6ba83ba9ee
This commit is contained in:
Christian Clason
2022-06-14 08:52:04 +02:00
committed by GitHub
parent 619eb32c75
commit 2f2022773f
5 changed files with 77 additions and 25 deletions

View File

@@ -4476,7 +4476,7 @@ len({expr}) The result is a Number, which is the length of the argument.
When {expr} is a |Blob| the number of bytes is returned. When {expr} is a |Blob| the number of bytes is returned.
When {expr} is a |Dictionary| the number of entries in the When {expr} is a |Dictionary| the number of entries in the
|Dictionary| is returned. |Dictionary| is returned.
Otherwise an error is given. Otherwise an error is given and returns zero.
Can also be used as a |method|: > Can also be used as a |method|: >
mylist->len() mylist->len()
@@ -4563,6 +4563,7 @@ line({expr} [, {winid}]) *line()*
|getpos()|. |getpos()|.
With the optional {winid} argument the values are obtained for With the optional {winid} argument the values are obtained for
that window instead of the current window. that window instead of the current window.
Returns 0 for invalid values of {expr} and {winid}.
Examples: > Examples: >
line(".") line number of the cursor line(".") line number of the cursor
line(".", winid) idem, in window "winid" line(".", winid) idem, in window "winid"
@@ -4615,6 +4616,8 @@ list2str({list} [, {utf8}]) *list2str()*
With UTF-8 composing characters work as expected: > With UTF-8 composing characters work as expected: >
list2str([97, 769]) returns "á" list2str([97, 769]) returns "á"
< <
Returns an empty string on error.
Can also be used as a |method|: > Can also be used as a |method|: >
GetList()->list2str() GetList()->list2str()
@@ -4627,6 +4630,7 @@ log({expr}) *log()*
Return the natural logarithm (base e) of {expr} as a |Float|. Return the natural logarithm (base e) of {expr} as a |Float|.
{expr} must evaluate to a |Float| or a |Number| in the range {expr} must evaluate to a |Float| or a |Number| in the range
(0, inf]. (0, inf].
Returns 0.0 if {expr} is not a |Float| or a |Number|.
Examples: > Examples: >
:echo log(10) :echo log(10)
< 2.302585 > < 2.302585 >
@@ -4639,6 +4643,7 @@ log({expr}) *log()*
log10({expr}) *log10()* log10({expr}) *log10()*
Return the logarithm of Float {expr} to base 10 as a |Float|. Return the logarithm of Float {expr} to base 10 as a |Float|.
{expr} must evaluate to a |Float| or a |Number|. {expr} must evaluate to a |Float| or a |Number|.
Returns 0.0 if {expr} is not a |Float| or a |Number|.
Examples: > Examples: >
:echo log10(1000) :echo log10(1000)
< 3.0 > < 3.0 >
@@ -4712,8 +4717,9 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()*
listing. listing.
When there is no mapping for {name}, an empty String is When there is no mapping for {name}, an empty String is
returned. When the mapping for {name} is empty, then "<Nop>" returned if {dict} is FALSE, otherwise returns an empty Dict.
is returned. When the mapping for {name} is empty, then "<Nop>" is
returned.
The {name} can have special key names, like in the ":map" The {name} can have special key names, like in the ":map"
command. command.
@@ -4912,6 +4918,8 @@ matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]])
The number of matches is not limited, as it is the case with The number of matches is not limited, as it is the case with
the |:match| commands. the |:match| commands.
Returns -1 on error.
Example: > Example: >
:highlight MyGroup ctermbg=green guibg=green :highlight MyGroup ctermbg=green guibg=green
:let m = matchadd("MyGroup", "TODO") :let m = matchadd("MyGroup", "TODO")
@@ -4954,6 +4962,8 @@ matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]])
The maximum number of positions in {pos} is 8. The maximum number of positions in {pos} is 8.
Returns -1 on error.
Example: > Example: >
:highlight MyGroup ctermbg=green guibg=green :highlight MyGroup ctermbg=green guibg=green
:let m = matchaddpos("MyGroup", [[23, 24], 34]) :let m = matchaddpos("MyGroup", [[23, 24], 34])
@@ -5457,6 +5467,7 @@ pathshorten({expr} [, {len}]) *pathshorten()*
:echo pathshorten('~/.config/nvim/autoload/file2.vim', 2) :echo pathshorten('~/.config/nvim/autoload/file2.vim', 2)
< ~/.co/nv/au/file2.vim ~ < ~/.co/nv/au/file2.vim ~
It doesn't matter if the path exists or not. It doesn't matter if the path exists or not.
Returns an empty string on error.
Can also be used as a |method|: > Can also be used as a |method|: >
GetDirectories()->pathshorten() GetDirectories()->pathshorten()
@@ -5482,6 +5493,7 @@ perleval({expr}) *perleval()*
pow({x}, {y}) *pow()* pow({x}, {y}) *pow()*
Return the power of {x} to the exponent {y} as a |Float|. Return the power of {x} to the exponent {y} as a |Float|.
{x} and {y} must evaluate to a |Float| or a |Number|. {x} and {y} must evaluate to a |Float| or a |Number|.
Returns 0.0 if {x} or {y} is not a |Float| or a |Number|.
Examples: > Examples: >
:echo pow(3, 3) :echo pow(3, 3)
< 27.0 > < 27.0 >
@@ -5852,6 +5864,7 @@ rand([{expr}]) *rand()*
{expr} can be initialized by |srand()| and will be updated by {expr} can be initialized by |srand()| and will be updated by
rand(). If {expr} is omitted, an internal seed value is used rand(). If {expr} is omitted, an internal seed value is used
and updated. and updated.
Returns -1 if {expr} is invalid.
Examples: > Examples: >
:echo rand() :echo rand()
@@ -5889,6 +5902,8 @@ readdir({directory} [, {expr}])
endfunction endfunction
echo s:tree(".") echo s:tree(".")
< <
Returns an empty List on error.
Can also be used as a |method|: > Can also be used as a |method|: >
GetDirName()->readdir() GetDirName()->readdir()
< <
@@ -5977,7 +5992,7 @@ reltime([{start} [, {end}]]) *reltime()*
and {end}. and {end}.
The {start} and {end} arguments must be values returned by The {start} and {end} arguments must be values returned by
reltime(). reltime(). Returns zero on error.
Can also be used as a |method|: > Can also be used as a |method|: >
GetStart()->reltime() GetStart()->reltime()
@@ -6023,6 +6038,7 @@ remove({list}, {idx} [, {end}]) *remove()*
item as {end} a list with one item is returned. When {end} item as {end} a list with one item is returned. When {end}
points to an item before {idx} this is an error. points to an item before {idx} this is an error.
See |list-index| for possible values of {idx} and {end}. See |list-index| for possible values of {idx} and {end}.
Returns zero on error.
Example: > Example: >
:echo "last item: " .. remove(mylist, -1) :echo "last item: " .. remove(mylist, -1)
:call remove(mylist, 0, 9) :call remove(mylist, 0, 9)
@@ -6039,6 +6055,7 @@ remove({blob}, {idx} [, {end}])
return a |Blob| with these bytes. When {idx} points to the same return a |Blob| with these bytes. When {idx} points to the same
byte as {end} a |Blob| with one byte is returned. When {end} byte as {end} a |Blob| with one byte is returned. When {end}
points to a byte before {idx} this is an error. points to a byte before {idx} this is an error.
Returns zero on error.
Example: > Example: >
:echo "last byte: " .. remove(myblob, -1) :echo "last byte: " .. remove(myblob, -1)
:call remove(mylist, 0, 9) :call remove(mylist, 0, 9)
@@ -6048,6 +6065,7 @@ remove({dict}, {key})
Example: > Example: >
:echo "removed " .. remove(dict, "one") :echo "removed " .. remove(dict, "one")
< If there is no {key} in {dict} this is an error. < If there is no {key} in {dict} this is an error.
Returns zero on error.
rename({from}, {to}) *rename()* rename({from}, {to}) *rename()*
Rename the file by the name {from} to the name {to}. This Rename the file by the name {from} to the name {to}. This
@@ -6094,6 +6112,7 @@ reverse({object})
Reverse the order of items in {object} in-place. Reverse the order of items in {object} in-place.
{object} can be a |List| or a |Blob|. {object} can be a |List| or a |Blob|.
Returns {object}. Returns {object}.
Returns zero if {object} is not a List or a Blob.
If you want an object to remain unmodified make a copy first: > If you want an object to remain unmodified make a copy first: >
:let revlist = reverse(copy(mylist)) :let revlist = reverse(copy(mylist))
< Can also be used as a |method|: > < Can also be used as a |method|: >
@@ -6104,6 +6123,7 @@ round({expr}) *round()*
as a |Float|. If {expr} lies halfway between two integral as a |Float|. If {expr} lies halfway between two integral
values, then use the larger one (away from zero). values, then use the larger one (away from zero).
{expr} must evaluate to a |Float| or a |Number|. {expr} must evaluate to a |Float| or a |Number|.
Returns 0.0 if {expr} is not a |Float| or a |Number|.
Examples: > Examples: >
echo round(0.456) echo round(0.456)
< 0.0 > < 0.0 >
@@ -6150,6 +6170,7 @@ screenattr({row}, {col}) *screenattr()*
Like |screenchar()|, but return the attribute. This is a rather Like |screenchar()|, but return the attribute. This is a rather
arbitrary number that can only be used to compare to the arbitrary number that can only be used to compare to the
attribute at other positions. attribute at other positions.
Returns -1 when row or col is out of range.
Can also be used as a |method|: > Can also be used as a |method|: >
GetRow()->screenattr(col) GetRow()->screenattr(col)
@@ -6208,9 +6229,10 @@ screenpos({winid}, {lnum}, {col}) *screenpos()*
a Tab it would be the same as "endcol", while for a double a Tab it would be the same as "endcol", while for a double
width character it would be the same as "col". width character it would be the same as "col".
The |conceal| feature is ignored here, the column numbers are The |conceal| feature is ignored here, the column numbers are
as if 'conceallevel' is zero. You can set the cursor to the as if 'conceallevel' is zero. You can set the cursor to the
right position and use |screencol()| to get the value with right position and use |screencol()| to get the value with
|conceal| taken into account. |conceal| taken into account.
Returns an empty Dict if {winid} is invalid.
Can also be used as a |method|: > Can also be used as a |method|: >
GetWinid()->screenpos(lnum, col) GetWinid()->screenpos(lnum, col)
@@ -7242,6 +7264,7 @@ simplify({filename}) *simplify()*
sin({expr}) *sin()* sin({expr}) *sin()*
Return the sine of {expr}, measured in radians, as a |Float|. Return the sine of {expr}, measured in radians, as a |Float|.
{expr} must evaluate to a |Float| or a |Number|. {expr} must evaluate to a |Float| or a |Number|.
Returns 0.0 if {expr} is not a |Float| or a |Number|.
Examples: > Examples: >
:echo sin(100) :echo sin(100)
< -0.506366 > < -0.506366 >
@@ -7255,6 +7278,7 @@ sinh({expr}) *sinh()*
Return the hyperbolic sine of {expr} as a |Float| in the range Return the hyperbolic sine of {expr} as a |Float| in the range
[-inf, inf]. [-inf, inf].
{expr} must evaluate to a |Float| or a |Number|. {expr} must evaluate to a |Float| or a |Number|.
Returns 0.0 if {expr} is not a |Float| or a |Number|.
Examples: > Examples: >
:echo sinh(0.5) :echo sinh(0.5)
< 0.521095 > < 0.521095 >
@@ -7455,7 +7479,8 @@ sqrt({expr}) *sqrt()*
Return the non-negative square root of Float {expr} as a Return the non-negative square root of Float {expr} as a
|Float|. |Float|.
{expr} must evaluate to a |Float| or a |Number|. When {expr} {expr} must evaluate to a |Float| or a |Number|. When {expr}
is negative the result is NaN (Not a Number). is negative the result is NaN (Not a Number). Returns 0.0 if
{expr} is not a |Float| or a |Number|.
Examples: > Examples: >
:echo sqrt(100) :echo sqrt(100)
< 10.0 > < 10.0 >
@@ -7543,6 +7568,8 @@ str2float({string} [, {quoted}]) *str2float()*
|substitute()|: > |substitute()|: >
let f = str2float(substitute(text, ',', '', 'g')) let f = str2float(substitute(text, ',', '', 'g'))
< <
Returns 0.0 if the conversion fails.
Can also be used as a |method|: > Can also be used as a |method|: >
let f = text->substitute(',', '', 'g')->str2float() let f = text->substitute(',', '', 'g')->str2float()
@@ -7578,6 +7605,8 @@ str2nr({string} [, {base}]) *str2nr()*
{base} is 2 a leading "0b" or "0B" is ignored. {base} is 2 a leading "0b" or "0B" is ignored.
Text after the number is silently ignored. Text after the number is silently ignored.
Returns 0 if {string} is empty or on error.
Can also be used as a |method|: > Can also be used as a |method|: >
GetText()->str2nr() GetText()->str2nr()

View File

@@ -282,7 +282,7 @@ tag char note action in Normal mode ~
|/| /{pattern}<CR> 1 search forward for the Nth occurrence of |/| /{pattern}<CR> 1 search forward for the Nth occurrence of
{pattern} {pattern}
|/<CR>| /<CR> 1 search forward for {pattern} of last search |/<CR>| /<CR> 1 search forward for {pattern} of last search
|count| 0 1 cursor to the first char of the line |0| 0 1 cursor to the first char of the line
|count| 1 prepend to command to give a count |count| 1 prepend to command to give a count
|count| 2 " |count| 2 "
|count| 3 " |count| 3 "

View File

@@ -2,7 +2,8 @@
" Language: M4 " Language: M4
" Maintainer: Claudio Fleiner (claudio@fleiner.com) " Maintainer: Claudio Fleiner (claudio@fleiner.com)
" URL: http://www.fleiner.com/vim/syntax/m4.vim " URL: http://www.fleiner.com/vim/syntax/m4.vim
" Last Change: 2005 Jan 15 " (outdated)
" Last Change: 2022 Jun 12
" This file will highlight user function calls if they use only " This file will highlight user function calls if they use only
" capital letters and have at least one argument (i.e. the '(' " capital letters and have at least one argument (i.e. the '('

View File

@@ -2,8 +2,8 @@
" Language: shell (sh) Korn shell (ksh) bash (sh) " Language: shell (sh) Korn shell (ksh) bash (sh)
" Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM> " Maintainer: Charles E. Campbell <NcampObell@SdrPchip.AorgM-NOSPAM>
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int> " Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
" Last Change: Oct 26, 2021 " Last Change: Jun 09, 2022
" Version: 199 " Version: 201
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
" For options and settings, please use: :help ft-sh-syntax " For options and settings, please use: :help ft-sh-syntax
" This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) and heredoc fixes from Felipe Contreras " This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) and heredoc fixes from Felipe Contreras
@@ -138,7 +138,7 @@ syn cluster shErrorList contains=shDoError,shIfError,shInError,shCaseError,shEsa
if exists("b:is_kornshell") || exists("b:is_bash") if exists("b:is_kornshell") || exists("b:is_bash")
syn cluster ErrorList add=shDTestError syn cluster ErrorList add=shDTestError
endif endif
syn cluster shArithParenList contains=shArithmetic,shCaseEsac,shComment,shDeref,shDo,shDerefSimple,shEcho,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shExDoubleQuote,shHereString,shRedir,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen,bashSpecialVariables,bashStatement,shIf,shFor,shFunctionKey,shFunctionOne,shFunctionTwo syn cluster shArithParenList contains=shArithmetic,shArithParen,shCaseEsac,shComment,shDeref,shDo,shDerefSimple,shEcho,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shExDoubleQuote,shHereString,shRedir,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen,bashSpecialVariables,bashStatement,shIf,shFor,shFunctionKey,shFunctionOne,shFunctionTwo
syn cluster shArithList contains=@shArithParenList,shParenError syn cluster shArithList contains=@shArithParenList,shParenError
syn cluster shCaseEsacList contains=shCaseStart,shCaseLabel,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial,shCaseRange syn cluster shCaseEsacList contains=shCaseStart,shCaseLabel,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial,shCaseRange
syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSubBQ,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shCommandSubBQ,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq
@@ -147,8 +147,8 @@ if exists("b:is_kornshell") || exists("b:is_bash")
endif endif
syn cluster shCommandSubList contains=shAlias,shArithmetic,shCmdParenRegion,shCommandSub,shComment,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shHereDoc,shNumber,shOperator,shOption,shPosnParm,shHereString,shRedir,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable syn cluster shCommandSubList contains=shAlias,shArithmetic,shCmdParenRegion,shCommandSub,shComment,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shHereDoc,shNumber,shOperator,shOption,shPosnParm,shHereString,shRedir,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable
syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial
" COMBAK: removing shEscape from shDblQuoteList fails ksh04:43 " COMBAK: removing shEscape from shDblQuoteList fails ksh04:43 -- Jun 09, 2022: I don't see the problem with ksh04, so am reinstating shEscape
syn cluster shDblQuoteList contains=shArithmetic,shCommandSub,shCommandSubBQ,shDeref,shDerefSimple,shPosnParm,shCtrlSeq,shSpecial,shSpecialDQ syn cluster shDblQuoteList contains=shArithmetic,shCommandSub,shCommandSubBQ,shDeref,shDerefSimple,shEscape,shPosnParm,shCtrlSeq,shSpecial,shSpecialDQ
syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPSR,shDerefPPS syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPSR,shDerefPPS
syn cluster shDerefVarList contains=shDerefOffset,shDerefOp,shDerefVarArray,shDerefOpError syn cluster shDerefVarList contains=shDerefOffset,shDerefOp,shDerefVarArray,shDerefOpError
syn cluster shEchoList contains=shArithmetic,shCommandSub,shCommandSubBQ,shDeref,shDerefSimple,shEscape,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shCtrlSeq,shEchoQuote syn cluster shEchoList contains=shArithmetic,shCommandSub,shCommandSubBQ,shDeref,shDerefSimple,shEscape,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shCtrlSeq,shEchoQuote
@@ -157,11 +157,12 @@ syn cluster shExprList2 contains=@shExprList1,@shCaseList,shTest
syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shOption,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shOperator,shCtrlSeq syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shOption,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shOperator,shCtrlSeq
if exists("b:is_kornshell") || exists("b:is_bash") if exists("b:is_kornshell") || exists("b:is_bash")
syn cluster shFunctionList add=shRepeat,shDblBrace,shDblParen,shForPP syn cluster shFunctionList add=shRepeat,shDblBrace,shDblParen,shForPP
syn cluster shDerefList add=shCommandSubList,shEchoDeref
endif endif
syn cluster shHereBeginList contains=@shCommandSubList syn cluster shHereBeginList contains=@shCommandSubList
syn cluster shHereList contains=shBeginHere,shHerePayload syn cluster shHereList contains=shBeginHere,shHerePayload
syn cluster shHereListDQ contains=shBeginHere,@shDblQuoteList,shHerePayload syn cluster shHereListDQ contains=shBeginHere,@shDblQuoteList,shHerePayload
syn cluster shIdList contains=shCommandSub,shCommandSubBQ,shWrapLineOperator,shSetOption,shComment,shDeref,shDerefSimple,shHereString,shNumber,shOperator,shRedir,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq,shStringSpecial,shAtExpr syn cluster shIdList contains=shArithmetic,shCommandSub,shCommandSubBQ,shWrapLineOperator,shSetOption,shComment,shDeref,shDerefSimple,shHereString,shNumber,shOperator,shRedir,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq,shStringSpecial,shAtExpr
syn cluster shIfList contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey,shFunctionOne,shFunctionTwo syn cluster shIfList contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey,shFunctionOne,shFunctionTwo
syn cluster shLoopList contains=@shCaseList,@shErrorList,shCaseEsac,shConditional,shDblBrace,shExpr,shFor,shIf,shOption,shSet,shTest,shTestOpr,shTouch syn cluster shLoopList contains=@shCaseList,@shErrorList,shCaseEsac,shConditional,shDblBrace,shExpr,shFor,shIf,shOption,shSet,shTest,shTestOpr,shTouch
if exists("b:is_kornshell") || exists("b:is_bash") if exists("b:is_kornshell") || exists("b:is_bash")
@@ -179,6 +180,10 @@ syn cluster shForList contains=shTestOpr,shNumber,shDerefSimple,shDeref,shComman
" This one is needed INSIDE a CommandSub, so that `echo bla` be correct " This one is needed INSIDE a CommandSub, so that `echo bla` be correct
syn region shEcho matchgroup=shStatement start="\<echo\>" skip="\\$" matchgroup=shEchoDelim end="$" matchgroup=NONE end="[<>;&|()`]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=@shEchoList skipwhite nextgroup=shQuickComment syn region shEcho matchgroup=shStatement start="\<echo\>" skip="\\$" matchgroup=shEchoDelim end="$" matchgroup=NONE end="[<>;&|()`]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=@shEchoList skipwhite nextgroup=shQuickComment
syn region shEcho matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shEchoDelim end="$" matchgroup=NONE end="[<>;&|()`]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=@shEchoList skipwhite nextgroup=shQuickComment syn region shEcho matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shEchoDelim end="$" matchgroup=NONE end="[<>;&|()`]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=@shEchoList skipwhite nextgroup=shQuickComment
if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix")
syn region shEchoDeref contained matchgroup=shStatement start="\<echo\>" skip="\\$" matchgroup=shEchoDelim end="$" end="[<>;&|()`}]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=@shEchoList skipwhite nextgroup=shQuickComment
syn region shEchoDeref contained matchgroup=shStatement start="\<print\>" skip="\\$" matchgroup=shEchoDelim end="$" end="[<>;&|()`}]"me=e-1 end="\d[<>]"me=e-2 end="#"me=e-1 contains=@shEchoList skipwhite nextgroup=shQuickComment
endif
syn match shEchoQuote contained '\%(\\\\\)*\\["`'()]' syn match shEchoQuote contained '\%(\\\\\)*\\["`'()]'
" This must be after the strings, so that ... \" will be correct " This must be after the strings, so that ... \" will be correct
@@ -291,13 +296,15 @@ syn match shCaseStart contained skipwhite skipnl "(" nextgroup=shCase,shCaseBa
syn match shCaseLabel contained skipwhite "\%(\\.\|[-a-zA-Z0-9_*.]\)\+" contains=shCharClass syn match shCaseLabel contained skipwhite "\%(\\.\|[-a-zA-Z0-9_*.]\)\+" contains=shCharClass
if exists("b:is_bash") if exists("b:is_bash")
ShFoldIfDoFor syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end=";&" end=";;&" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment ShFoldIfDoFor syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end=";&" end=";;&" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment
elseif exists("b:is_kornshell")
ShFoldIfDoFor syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end=";&" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment
else else
ShFoldIfDoFor syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment ShFoldIfDoFor syn region shCase contained skipwhite skipnl matchgroup=shSnglCase start="\%(\\.\|[^#$()'" \t]\)\{-}\zs)" end=";;" end="esac"me=s-1 contains=@shCaseList nextgroup=shCaseStart,shCase,shComment
endif endif
ShFoldIfDoFor syn region shCaseEsac matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList ShFoldIfDoFor syn region shCaseEsac matchgroup=shConditional start="\<case\>" end="\<esac\>" contains=@shCaseEsacList
syn keyword shCaseIn contained skipwhite skipnl in nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote syn keyword shCaseIn contained skipwhite skipnl in nextgroup=shCase,shCaseStart,shCaseBar,shComment,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote
if exists("b:is_bash") if exists("b:is_bash") || exists("b:is_kornshell")
syn region shCaseExSingleQuote matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial skipwhite skipnl nextgroup=shCaseBar contained syn region shCaseExSingleQuote matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial skipwhite skipnl nextgroup=shCaseBar contained
elseif !exists("g:sh_no_error") elseif !exists("g:sh_no_error")
syn region shCaseExSingleQuote matchgroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained syn region shCaseExSingleQuote matchgroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial skipwhite skipnl nextgroup=shCaseBar contained
@@ -329,10 +336,11 @@ syn match shEscape contained '\%(^\)\@!\%(\\\\\)*\\.' nextgroup=shComment
" systems too, however, so the following syntax will flag $(..) as " systems too, however, so the following syntax will flag $(..) as
" an Error under /bin/sh. By consensus of vimdev'ers! " an Error under /bin/sh. By consensus of vimdev'ers!
if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix") if exists("b:is_kornshell") || exists("b:is_bash") || exists("b:is_posix")
syn region shCommandSub matchgroup=shCmdSubRegion start="\$(" skip='\\\\\|\\.' end=")" contains=@shCommandSubList syn region shCommandSub matchgroup=shCmdSubRegion start="\$(\ze[^(]" skip='\\\\\|\\.' end=")" contains=@shCommandSubList
syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" contains=@shArithList syn region shArithmetic matchgroup=shArithRegion start="\$((" skip='\\\\\|\\.' end="))" contains=@shArithList
syn region shArithmetic matchgroup=shArithRegion start="\$\[" skip='\\\\\|\\.' end="\]" contains=@shArithList syn region shArithmetic matchgroup=shArithRegion start="\$\[" skip='\\\\\|\\.' end="\]" contains=@shArithList
syn match shSkipInitWS contained "^\s\+" syn match shSkipInitWS contained "^\s\+"
syn region shArithParen matchgroup=shArithRegion contained start="(" end=")" contains=@shArithParenList
elseif !exists("g:sh_no_error") elseif !exists("g:sh_no_error")
syn region shCommandSub matchgroup=Error start="\$(" end=")" contains=@shCommandSubList syn region shCommandSub matchgroup=Error start="\$(" end=")" contains=@shCommandSubList
endif endif
@@ -368,7 +376,7 @@ endif
syn match shNumber "\<\d\+\>#\=" syn match shNumber "\<\d\+\>#\="
syn match shNumber "\<-\=\.\=\d\+\>#\=" syn match shNumber "\<-\=\.\=\d\+\>#\="
syn match shCtrlSeq "\\\d\d\d\|\\[abcfnrtv0]" contained syn match shCtrlSeq "\\\d\d\d\|\\[abcfnrtv0]" contained
if exists("b:is_bash") if exists("b:is_bash") || exists("b:is_kornshell")
syn match shSpecial "[^\\]\(\\\\\)*\zs\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[abefnrtv]" contained syn match shSpecial "[^\\]\(\\\\\)*\zs\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[abefnrtv]" contained
syn match shSpecial "^\(\\\\\)*\zs\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[abefnrtv]" contained syn match shSpecial "^\(\\\\\)*\zs\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[abefnrtv]" contained
syn region shExSingleQuote matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial nextgroup=shSpecialNxt syn region shExSingleQuote matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial nextgroup=shSpecialNxt
@@ -441,19 +449,24 @@ syn match shVar contained "\h\w*"
syn region shAtExpr contained start="@(" end=")" contains=@shIdList syn region shAtExpr contained start="@(" end=")" contains=@shIdList
if exists("b:is_bash") if exists("b:is_bash")
syn match shSet "^\s*set\ze\s\+$" syn match shSet "^\s*set\ze\s\+$"
syn region shSetList oneline matchgroup=shSet start="\<\%(declare\|local\|export\)\>\ze[/a-zA-Z_]\@!" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+#\|=" contains=@shIdList syn region shSetList oneline matchgroup=shSet start="\<\%(declare\|local\|export\)\>\ze[/a-zA-Z_]\@!" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+#\|=" contains=@shIdList
syn region shSetList oneline matchgroup=shSet start="\<\%(set\|unset\)\>[/a-zA-Z_]\@!" end="\ze[;|#)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+=" contains=@shIdList nextgroup=shComment syn region shSetList oneline matchgroup=shSet start="\<\%(set\|unset\)\>[/a-zA-Z_]\@!" end="\ze[;|#)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+=" contains=@shIdList nextgroup=shComment
elseif exists("b:is_kornshell") || exists("b:is_posix") elseif exists("b:is_kornshell") || exists("b:is_posix")
syn match shSet "^\s*set\ze\s\+$" syn match shSet "^\s*set\ze\s\+$"
if exists("b:is_dash") if exists("b:is_dash")
syn region shSetList oneline matchgroup=shSet start="\<\%(local\)\>\ze[/]\@!" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList syn region shSetList oneline matchgroup=shSet start="\<\%(local\)\>\ze[/]\@!" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList
endif endif
syn region shSetList oneline matchgroup=shSet start="\<\(export\)\>\ze[/]\@!" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList syn region shSetList oneline matchgroup=shSet start="\<\(export\)\>\ze[/]\@!" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList
syn region shSetList oneline matchgroup=shSet start="\<\%(set\|unset\>\)\ze[/a-zA-Z_]\@!" end="\ze[;|#)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList nextgroup=shComment syn region shSetList oneline matchgroup=shSet start="\<\%(set\|unset\>\)\ze[/a-zA-Z_]\@!" end="\ze[;|#)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList nextgroup=shComment
else else
syn region shSetList oneline matchgroup=shSet start="\<\(set\|export\|unset\)\>\ze[/a-zA-Z_]\@!" end="\ze[;|#)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList syn region shSetList oneline matchgroup=shSet start="\<\(set\|export\|unset\)\>\ze[/a-zA-Z_]\@!" end="\ze[;|#)]\|$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+[#=]" contains=@shIdList
endif endif
" KornShell namespace: {{{1
if exists("b:is_kornshell")
syn keyword shFunctionKey namespace skipwhite skipnl nextgroup=shFunctionTwo
endif
" Functions: {{{1 " Functions: {{{1
if !exists("b:is_posix") if !exists("b:is_posix")
syn keyword shFunctionKey function skipwhite skipnl nextgroup=shFunctionTwo syn keyword shFunctionKey function skipwhite skipnl nextgroup=shFunctionTwo
@@ -473,7 +486,7 @@ endif
" Parameter Dereferencing: {{{1 " Parameter Dereferencing: {{{1
" ======================== " ========================
if !exists("g:sh_no_error") if !exists("g:sh_no_error") && !(exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix"))
syn match shDerefWordError "[^}$[~]" contained syn match shDerefWordError "[^}$[~]" contained
endif endif
syn match shDerefSimple "\$\%(\h\w*\|\d\)" nextgroup=@shNoZSList syn match shDerefSimple "\$\%(\h\w*\|\d\)" nextgroup=@shNoZSList
@@ -486,6 +499,13 @@ if exists("b:is_bash") || exists("b:is_kornshell") || exists("b:is_posix")
syn region shDeref matchgroup=PreProc start="\${\$\$" end="}" contains=@shDerefList nextgroup=@shSpecialNoZS,shSpecialStart syn region shDeref matchgroup=PreProc start="\${\$\$" end="}" contains=@shDerefList nextgroup=@shSpecialNoZS,shSpecialStart
endif endif
" ksh: ${.sh.*} variables: {{{1
" ========================================
if exists("b:is_kornshell")
" syn match shDerefVar contained "[.]*" nextgroup=@shDerefVarList
syn match shDerefVar contained "\.\+" nextgroup=@shDerefVarList
endif
" ksh: ${!var[*]} array index list syntax: {{{1 " ksh: ${!var[*]} array index list syntax: {{{1
" ======================================== " ========================================
if exists("b:is_kornshell") || exists("b:is_posix") if exists("b:is_kornshell") || exists("b:is_posix")

View File

@@ -296,7 +296,7 @@ syn match vimPatSep contained "\\|"
syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\=\ze(" skip="\\\\" end="\\)\|[^\\]['"]" contains=@vimStringGroup syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\=\ze(" skip="\\\\" end="\\)\|[^\\]['"]" contains=@vimStringGroup
syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline
syn match vimNotPatSep contained "\\\\" syn match vimNotPatSep contained "\\\\"
syn cluster vimStringGroup contains=vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell syn cluster vimStringGroup contains=vimEscape,vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell
syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ contains=@vimStringGroup
syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]'+lc=1 end=+'+ syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]'+lc=1 end=+'+
syn region vimString oneline start=+=!+lc=1 skip=+\\\\\|\\!+ end=+!+ contains=@vimStringGroup syn region vimString oneline start=+=!+lc=1 skip=+\\\\\|\\!+ end=+!+ contains=@vimStringGroup
@@ -304,6 +304,7 @@ syn region vimString oneline start="=+"lc=1 skip="\\\\\|\\+" end="+" contains=@v
"syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim "syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim
syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont syn match vimString contained +"[^"]*\\$+ skipnl nextgroup=vimStringCont
syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+ syn match vimStringCont contained +\(\\\\\|.\)\{-}[^\\]"+
syn match vimEscape contained "\\."
" Substitutions: {{{2 " Substitutions: {{{2
" ============= " =============
@@ -434,7 +435,7 @@ syn case match
" User Function Highlighting: {{{2 " User Function Highlighting: {{{2
" (following Gautam Iyer's suggestion) " (following Gautam Iyer's suggestion)
" ========================== " ==========================
syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimCommand,vimFuncEcho,vimFuncName,vimUserFunc,vimExecute syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncEcho,vimFuncName,vimUserFunc,vimExecute
syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>" contains=vimCommand,vimNotation syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\<if\>" contains=vimCommand,vimNotation
syn keyword vimFuncEcho contained ec ech echo syn keyword vimFuncEcho contained ec ech echo
@@ -871,6 +872,7 @@ if !exists("skip_vim_syntax_inits")
hi def link vimElseif vimCondHL hi def link vimElseif vimCondHL
hi def link vimEnvvar PreProc hi def link vimEnvvar PreProc
hi def link vimError Error hi def link vimError Error
hi def link vimEscape Special
hi def link vimFBVar vimVar hi def link vimFBVar vimVar
hi def link vimFgBgAttrib vimHiAttrib hi def link vimFgBgAttrib vimHiAttrib
hi def link vimFuncEcho vimCommand hi def link vimFuncEcho vimCommand