mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
45 lines
2.1 KiB
VimL
45 lines
2.1 KiB
VimL
if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'typescript') == -1
|
|
|
|
" + - ^ ~
|
|
syntax match typescriptUnaryOp /[+\-~!]/
|
|
\ nextgroup=@typescriptValue
|
|
\ skipwhite
|
|
|
|
syntax region typescriptTernary matchgroup=typescriptTernaryOp start=/?[.?]\@!/ end=/:/ contained contains=@typescriptValue,@typescriptComments nextgroup=@typescriptValue skipwhite skipempty
|
|
|
|
syntax match typescriptAssign /=/ nextgroup=@typescriptValue
|
|
\ skipwhite skipempty
|
|
|
|
" 2: ==, ===
|
|
syntax match typescriptBinaryOp contained /===\?/ nextgroup=@typescriptValue skipwhite skipempty
|
|
" 6: >>>=, >>>, >>=, >>, >=, >
|
|
syntax match typescriptBinaryOp contained />\(>>=\|>>\|>=\|>\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
|
" 4: <<=, <<, <=, <
|
|
syntax match typescriptBinaryOp contained /<\(<=\|<\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
|
" 3: ||, |=, |, ||=
|
|
syntax match typescriptBinaryOp contained /||\?=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
|
" 4: &&, &=, &, &&=
|
|
syntax match typescriptBinaryOp contained /&&\?=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
|
" 2: ??, ??=
|
|
syntax match typescriptBinaryOp contained /??=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
|
" 2: *=, *
|
|
syntax match typescriptBinaryOp contained /\*=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
|
" 2: %=, %
|
|
syntax match typescriptBinaryOp contained /%=\?/ nextgroup=@typescriptValue skipwhite skipempty
|
|
" 2: /=, /
|
|
syntax match typescriptBinaryOp contained +/\(=\|[^\*/]\@=\)+ nextgroup=@typescriptValue skipwhite skipempty
|
|
syntax match typescriptBinaryOp contained /!==\?/ nextgroup=@typescriptValue skipwhite skipempty
|
|
" 2: !=, !==
|
|
syntax match typescriptBinaryOp contained /+\(+\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
|
" 3: +, ++, +=
|
|
syntax match typescriptBinaryOp contained /-\(-\|=\)\?/ nextgroup=@typescriptValue skipwhite skipempty
|
|
" 3: -, --, -=
|
|
|
|
" exponentiation operator
|
|
" 2: **, **=
|
|
syntax match typescriptBinaryOp contained /\*\*=\?/ nextgroup=@typescriptValue
|
|
|
|
syntax cluster typescriptSymbols contains=typescriptBinaryOp,typescriptKeywordOp,typescriptTernary,typescriptAssign,typescriptCastKeyword
|
|
|
|
endif
|