From bb09e8b8d13b77f2a01d6b5281383cfd0d7f7d2e Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sun, 24 May 2026 20:26:29 +0100 Subject: [PATCH] vim: add operator symbols and keywords --- bshell.vim/syntax/bshell.vim | 38 +++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/bshell.vim/syntax/bshell.vim b/bshell.vim/syntax/bshell.vim index 2ae8f84..5da91d4 100755 --- a/bshell.vim/syntax/bshell.vim +++ b/bshell.vim/syntax/bshell.vim @@ -7,9 +7,11 @@ set cpoptions&vim setlocal iskeyword+=- syn match bshellFunctionRef /\<[A-Za-z][A-Za-z0-9]*\(-[A-Za-z0-9][A-Za-z0-9]*\)\+\>/ -syn match bshellVariable /\$[A-Za-z][A-Za-z0-9_]*/ +syn match bshellVariable /\$[A-Za-z_][A-Za-z0-9_]*/ syn match bshellArgFlag /\<-[A-Za-z][A-Za-z0-9]*\(-[A-Za-z0-9][A-Za-z0-9]*\)*\>/ -syn keyword bshellKeyword func +syn keyword bshellKeyword func if elseif else + +syn keyword bshellBuiltinCommand echo syn keyword bshellTodo contained TODO FIXME XXX NOTE HACK TBD syn match bshellLineComment /#.*$/ contains=bshellTodo @@ -33,16 +35,33 @@ syn case match syn cluster bshellNumber contains=bshellInteger,bshellReal syn cluster bshellLiteral contains=@bshellNumber,@bshellString -syn cluster bshellAll contains=@bshellLiteral,bshellVariable,bshellKeyword,bshellArgFlag,bshellFunctionRef,bshellSymbolOp,bshellKeywordOp +syn cluster bshellAll contains= + \ @bshellLiteral,bshellVariable,bshellKeyword,bshellArgFlag, + \ bshellFunctionRef,bshellBuiltinCommand,bshellSymbolOp, + \ bshellKeywordOp,bshellTerminator,bshellControlSymbols, + \ bshellBraces,bshellParens,bshellStructureDelimiter -syn match bshellSymbolOp "[+]" display -syn keyword bshellKeywordOp is not understands and or +syn match bshellBraces "[{}]" display +syn match bshellParens "[()]" display +syn match bshellStructureDelimiter "@[{(]" display +syn match bshellControlSymbols "[[\]]" display +syn match bshellControlSymbols "|" display +syn match bshellSymbolOp "\*" display +syn match bshellSymbolOp "[\/*%&!,]" display +syn match bshellSymbolOp "[+\-/*%!]=" display +syn match bshellSymbolOp "\s\+[\-+]\s\+" display +syn match bshellTerminator "[;]" display +syn keyword bshellKeywordOp -f -band -bor -bxor -bnot -shl -shr + \ -eq -ne -gt -lt -ge -le -match -notmatch -replace + \ -like -notlike -in -notin -contains -notcontains + \ -and -or -xor -not -split -join -is -isnot -as hi def link bshellKeyword Statement hi def link bshellArgFlag Tag hi def link bshellVariable Identifier hi def link bshellLineComment Comment hi def link bshellFunctionRef Function +hi def link bshellBuiltinCommand Function hi def link bshellString String hi def link bshellInterpolatedString String hi def link bshellLiteralString String @@ -50,8 +69,13 @@ hi def link bshellInteger Number hi def link bshellReal Float hi def link bshellInterpolationDelimiter Delimiter -hi def link bshellSymbolOp Operator -hi def link bshellKeywordOp Operator +hi def link bshellStructureDelimiter Delimiter +hi def link bshellBraces Delimiter +hi def link bshellParens Delimiter +hi def link bshellControlSymbols Operator +hi def link bshellSymbolOp Operator +hi def link bshellKeywordOp Operator +hi def link bshellTerminator Delimiter " The default highlighting. " hi def link bshellUnspecifiedStatement Statement