Files
str/editor-support/vim/syntax/str.vim

46 lines
1.2 KiB
VimL
Raw Normal View History

2026-04-10 11:06:06 -05:00
" Vim syntax file
" Language: str (Interactive string manipulation environment)
" Maintainer: Garrett Mills <shout@garrettmills.dev>
if exists("b:current_syntax")
finish
endif
" Keywords (commands)
syn keyword strKeyword exit paste copy infile outfile assign clear show undo redo history edit save load runfile script
syn keyword strKeyword enclose lower upper lsub rsub prefix suffix quote unquote replace rev trim indent concat
syn keyword strKeyword line word each on drop take missing lines words split chunk join sort unique zip
syn match strKeyword "\<contains\>"
syn keyword strKeyword to from set over call lipsum
" Types
syn match strType "::\s*\zs\(string\|int\|destructured\)"
" Variables
syn match strVariable "\$\w\+"
" Operators
syn match strOperator "="
syn match strOperator ";"
syn match strOperator "::"
" Delimiters
syn match strDelimiter "[()|]"
" Strings
syn region strString start="'" end="'" skip="\\'"
" Comments
syn match strComment "--.*$"
" Default highlighting
hi def link strKeyword Keyword
hi def link strType Type
hi def link strVariable Identifier
hi def link strOperator Operator
hi def link strDelimiter Delimiter
hi def link strString String
hi def link strComment Comment
let b:current_syntax = "str"