meta: add vim plugin for syntax highlighting

This commit is contained in:
2026-05-07 10:46:19 +01:00
parent 416d86ad63
commit de0cad11b2
4 changed files with 131 additions and 0 deletions
View File
+1
View File
@@ -0,0 +1 @@
autocmd BufNewFile,BufRead *.bshell setfiletype bshell
+4
View File
@@ -0,0 +1,4 @@
setlocal tabstop=8
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal expandtab
+126
View File
@@ -0,0 +1,126 @@
if exists('b:current_syntax')
finish
endif
let s:save_cpo = &cpoptions
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 bshellArgFlag /\<-[A-Za-z][A-Za-z0-9]*\(-[A-Za-z0-9][A-Za-z0-9]*\)*\>/
syn keyword bshellKeyword func
syn keyword bshellTodo contained TODO FIXME XXX NOTE HACK TBD
syn match bshellLineComment /#.*$/ contains=bshellTodo
syn region bshellInterpolatedString matchgroup=bshellString start=+"+ end=+"+ extend contains=bshellVariable
syn region bshellLiteralString matchgroup=bshellString start=+\'+ end=+\'+ extend contains=bshellSpecialChar,bshellSpecialError,bshellUnicodeNumber,@Spell
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 bshellString String
hi def link bshellInterpolatedString String
hi def link bshellLiteralString String
" The default highlighting.
" hi def link bshellUnspecifiedStatement Statement
" hi def link bshellUnsupportedStatement Statement
"
" hi def link bshellGlobalNamespaceAlias Include
"
" hi def link bshellType Type
"
" hi def link bshellStorage Keyword
" hi def link bshellIsAs Keyword
" hi def link bshellAccessor Keyword
" hi def link bshellBuiltinVar @variable.builtin
" hi def link bshellSelfVar @variable.builtin
"
" hi def link bshellStatement Statement
" hi def link bshellRepeat Repeat
" hi def link bshellConditional Conditional
" hi def link bshellSelectorLabel Tag
" hi def link bshellUnnamedLabel Comment
" hi def link bshellUnnamedVariable Comment
" hi def link bshellLambdaParameter @variable.builtin
" hi def link bshellException Exception
"
" hi def link bshellParens Delimiter
" hi def link bshellBraces Structure
" hi def link bshellControlSymbols Keyword
"
" hi def link bshellModifier StorageClass
" hi def link bshellAccessModifier bshellModifier
" hi def link bshellAsyncModifier bshellModifier
" hi def link bshellCheckedModifier bshellModifier
" hi def link bshellManagedModifier bshellModifier
" hi def link bshellUsingModifier bshellModifier
"
" hi def link bshellTodo Todo
" hi def link bshellComment Comment
" hi def link bshellLineComment bshellComment
" hi def link bshellBlockComment bshellComment
" hi def link bshellLineContinuation bshellComment
"
" hi def link bshellKeywordOperator Keyword
" hi def link bshellAsyncOperator bshellKeywordOperator
" hi def link bshellTypeOf bshellKeywordOperator
" hi def link bshellTypeOfOperand Typedef
" hi def link bshellTypeOfError Error
" hi def link bshellOpSymbols Operator
" hi def link bshellPackageAccessOperator Operator
" hi def link bshellOtherSymbols Structure
" hi def link bshellLogicSymbols Operator
" hi def link bshellWordOperator Operator
"
" hi def link bshellSpecialError Error
" hi def link bshellSpecialCharError Error
" hi def link bshellString String
" hi def link bshellQuote String
" hi def link bshellInterpolatedString String
" hi def link bshellVerbatimString String
" hi def link bshellInterVerbString String
" hi def link bshellVerbatimQuote SpecialChar
"
" hi def link bshellConstant Constant
" hi def link bshellNull Constant
" hi def link bshellBoolean Boolean
" hi def link bshellCharacter Character
" hi def link bshellSpecialChar SpecialChar
" hi def link bshellInteger Number
" hi def link bshellReal Float
" hi def link bshellWord Identifier
" hi def link bshellUnicodeNumber SpecialChar
" hi def link bshellUnicodeSpecifier SpecialChar
" hi def link bshellInterpolationDelimiter Delimiter
" hi def link bshellInterpolationAlignDel bshellInterpolationDelimiter
" hi def link bshellInterpolationFormat bshellInterpolationDelimiter
" hi def link bshellInterpolationFormatDel bshellInterpolationDelimiter
"
" hi def link bshellGenericBraces bshellBraces
"
" hi def link bshellAtomName Constant
"
" hi def link bshellComplexMessageName Function
" hi def link bshellUnaryMessageName Function
" hi def link bshellPropertyName @property
" hi def link bshellPropertySymbol Statement
"
" hi def link bshellStatementSeparator Comment
" hi def link bshellMessageTerminator @punctuation.special
"
" hi def link bshellPackageStmtIdentifier @string.special.url
" hi def link bshellUseStmtIdentifier @module
let b:current_syntax = 'bshell'
let &cpoptions = s:save_cpo
unlet s:save_cpo
" vim: vts=16,28