mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-08 11:33:52 -05:00
Update
This commit is contained in:
83
syntax/bicep.vim
Normal file
83
syntax/bicep.vim
Normal file
@@ -0,0 +1,83 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'bicep', 'syntax/bicep.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpoptions
|
||||
set cpoptions&vim
|
||||
|
||||
if has('patch-7.4.1142')
|
||||
syn iskeyword a-z,A-Z,48-57,_,-
|
||||
endif
|
||||
|
||||
syn case match
|
||||
|
||||
|
||||
syn keyword bicepDataType array bool int object string contained
|
||||
|
||||
syn keyword bicepStatement var module targetScope
|
||||
|
||||
syn keyword bicepStatement param nextgroup=bicepParameterName skipwhite
|
||||
syn match bicepParameterName /\h\w*/ nextgroup=bicepDataType skipwhite contained
|
||||
|
||||
syn keyword bicepStatement output nextgroup=bicepOutputName skipwhite
|
||||
syn match bicepOutputName /\h\w*/ nextgroup=bicepDataType skipwhite contained
|
||||
|
||||
syn keyword bicepStatement resource nextgroup=bicepResourceName skipwhite
|
||||
syn match bicepResourceName /\h\w*/ nextgroup=bicepResourceString skipwhite contained
|
||||
syn region bicepResourceString start=/'/ skip=/\\\\\|\\'/ end=/'/ contains=bicepStringInterp nextgroup=bicepExisting skipwhite
|
||||
syn keyword bicepExisting existing contained
|
||||
|
||||
syn match bicepDecoratorName /@\s*\h\%(\w\|\.\)*/ contains=bicepDecorator
|
||||
syn match bicepDecorator /@/ contained
|
||||
|
||||
syn region bicepComment start="/\*" end="\*/" contains=bicepTodo,@Spell
|
||||
syn region bicepComment start="//" end="$" contains=bicepTodo,@Spell
|
||||
syn keyword bicepTodo TODO FIXME XXX BUG contained
|
||||
|
||||
syn keyword bicepValueBool true false
|
||||
syn keyword bicepValueNull null
|
||||
syn match bicepValueDec /\<[0-9]\+\([kKmMgG]b\?\)\?\>/
|
||||
|
||||
syn region bicepValueString start=/'/ skip=/\\\\\|\\'/ end=/'/ contains=bicepStringInterp,bicepEscape
|
||||
syn region bicepStringInterp start=/${/ end=/}/ contained
|
||||
syn match bicepEscape /\\n/ contained
|
||||
syn match bicepEscape /\\r/ contained
|
||||
|
||||
syn keyword bicepRepeat for in
|
||||
syn keyword bicepConditional if
|
||||
|
||||
syn match bicepBraces /[{}\[\]]/
|
||||
|
||||
|
||||
hi def link bicepDataType Type
|
||||
hi def link bicepStatement Statement
|
||||
hi def link bicepResourceString String
|
||||
hi def link bicepExisting Label
|
||||
|
||||
hi def link bicepDecorator Define
|
||||
|
||||
hi def link bicepComment Comment
|
||||
hi def link bicepTodo Todo
|
||||
|
||||
hi def link bicepValueBool Boolean
|
||||
hi def link bicepValueDec Number
|
||||
hi def link bicepValueNull Constant
|
||||
|
||||
hi def link bicepValueString String
|
||||
hi def link bicepStringInterp Identifier
|
||||
hi def link bicepEscape Special
|
||||
|
||||
hi def link bicepRepeat Repeat
|
||||
hi def link bicepConditional Conditional
|
||||
|
||||
hi def link bicepBraces Delimiter
|
||||
|
||||
|
||||
let b:current_syntax = 'bicep'
|
||||
|
||||
let &cpoptions = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
File diff suppressed because one or more lines are too long
@@ -149,6 +149,7 @@ syn region elixirDocString matchgroup=elixirDocSigilDelimiter start=+\%(@\w*doc
|
||||
" Defines
|
||||
syn match elixirDefine '\<def\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
|
||||
syn match elixirPrivateDefine '\<defp\>\(:\)\@!' nextgroup=elixirPrivateFunctionDeclaration skipwhite skipnl
|
||||
syn match elixirNumericalDefine '\<defn\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
|
||||
syn match elixirGuard '\<defguard\>\(:\)\@!' nextgroup=elixirFunctionDeclaration skipwhite skipnl
|
||||
syn match elixirPrivateGuard '\<defguardp\>\(:\)\@!' nextgroup=elixirPrivateFunctionDeclaration skipwhite skipnl
|
||||
syn match elixirModuleDefine '\<defmodule\>\(:\)\@!' nextgroup=elixirModuleDeclaration skipwhite skipnl
|
||||
@@ -191,6 +192,7 @@ syn sync minlines=2000
|
||||
hi def link elixirBlockDefinition Define
|
||||
hi def link elixirDefine Define
|
||||
hi def link elixirPrivateDefine Define
|
||||
hi def link elixirNumericalDefine Define
|
||||
hi def link elixirGuard Define
|
||||
hi def link elixirPrivateGuard Define
|
||||
hi def link elixirModuleDefine Define
|
||||
|
||||
@@ -8,7 +8,7 @@ endif
|
||||
" URL: https://github.com/vim-ruby/vim-ruby
|
||||
" Release Coordinator: Doug Kearns <dougkearns@gmail.com>
|
||||
|
||||
if &syntax !~# '\<eruby\>' || get(b:, 'current_syntax') =~# '\<eruby\>'
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
@@ -22,8 +22,6 @@ endif
|
||||
|
||||
if &filetype =~ '^eruby\.'
|
||||
let b:eruby_subtype = matchstr(&filetype,'^eruby\.\zs\w\+')
|
||||
elseif &filetype =~ '^.*\.eruby\>'
|
||||
let b:eruby_subtype = matchstr(&filetype,'^.\{-\}\ze\.eruby\>')
|
||||
elseif !exists("b:eruby_subtype") && main_syntax == 'eruby'
|
||||
let s:lines = getline(1)."\n".getline(2)."\n".getline(3)."\n".getline(4)."\n".getline(5)."\n".getline("$")
|
||||
let b:eruby_subtype = matchstr(s:lines,'eruby_subtype=\zs\w\+')
|
||||
@@ -57,10 +55,10 @@ if !b:eruby_nest_level
|
||||
let b:eruby_nest_level = 1
|
||||
endif
|
||||
|
||||
if get(b:, 'eruby_subtype', '') !~# '^\%(eruby\)\=$' && &syntax =~# '^eruby\>'
|
||||
if exists("b:eruby_subtype") && b:eruby_subtype != '' && b:eruby_subtype !=? 'eruby'
|
||||
exe "runtime! syntax/".b:eruby_subtype.".vim"
|
||||
unlet! b:current_syntax
|
||||
endif
|
||||
unlet! b:current_syntax
|
||||
syn include @rubyTop syntax/ruby.vim
|
||||
|
||||
syn cluster erubyRegions contains=erubyOneLiner,erubyBlock,erubyExpression,erubyComment
|
||||
@@ -75,7 +73,7 @@ exe 'syn region erubyComment matchgroup=erubyDelimiter start="<%\{1,'.b:erub
|
||||
hi def link erubyDelimiter PreProc
|
||||
hi def link erubyComment Comment
|
||||
|
||||
let b:current_syntax = matchstr(&syntax, '^.*\<eruby\>')
|
||||
let b:current_syntax = 'eruby'
|
||||
|
||||
if main_syntax == 'eruby'
|
||||
unlet main_syntax
|
||||
|
||||
@@ -170,13 +170,13 @@ syn match goSingleDecl /\%(import\|var\|const\) [^(]\@=/ contains=g
|
||||
|
||||
" Integers
|
||||
syn match goDecimalInt "\<-\=\(0\|[1-9]_\?\(\d\|\d\+_\?\d\+\)*\)\%([Ee][-+]\=\d\+\)\=\>"
|
||||
syn match goDecimalError "\<-\=\(_\(\d\+_*\)\+\|\([1-9]\d*_*\)\+__\(\d\+_*\)\+\|\([1-9]\d*_*\)\+_\+\)\%([Ee][-+]\=\d\+\)\=\>"
|
||||
"syn match goDecimalError "\<-\=\(_\(\d\+_*\)\+\|\([1-9]\d*_*\)\+__\(\d\+_*\)\+\|\([1-9]\d*_*\)\+_\+\)\%([Ee][-+]\=\d\+\)\=\>"
|
||||
syn match goHexadecimalInt "\<-\=0[xX]_\?\(\x\+_\?\)\+\>"
|
||||
syn match goHexadecimalError "\<-\=0[xX]_\?\(\x\+_\?\)*\(\([^ \t0-9A-Fa-f_)]\|__\)\S*\|_\)\>"
|
||||
"syn match goHexadecimalError "\<-\=0[xX]_\?\(\x\+_\?\)*\(\([^-+%&|^*/ \t0-9A-Fa-f_)]\|__\)\S*\|_\)\>"
|
||||
syn match goOctalInt "\<-\=0[oO]\?_\?\(\o\+_\?\)\+\>"
|
||||
syn match goOctalError "\<-\=0[0-7oO_]*\(\([^ \t0-7oOxX_/)\]\}\:;]\|[oO]\{2,\}\|__\)\S*\|_\|[oOxX]\)\>"
|
||||
"syn match goOctalError "\<-\=0[0-7oO_]*\(\([^-+%&|^*/ \t0-7oOxX_/)\]\}\:;]\|[oO]\{2,\}\|__\)\S*\|_\|[oOxX]\)\>"
|
||||
syn match goBinaryInt "\<-\=0[bB]_\?\([01]\+_\?\)\+\>"
|
||||
syn match goBinaryError "\<-\=0[bB]_\?[01_]*\([^ \t01_)]\S*\|__\S*\|_\)\>"
|
||||
"syn match goBinaryError "\<-\=0[bB]_\?[01_]*\([^-+%&|^*/ \t01_)]\S*\|__\S*\|_\)\>"
|
||||
|
||||
hi def link goDecimalInt Integer
|
||||
hi def link goDecimalError Error
|
||||
@@ -270,6 +270,8 @@ if go#config#HighlightOperators()
|
||||
syn match goOperator /\%(<<\|>>\|&^\)=\?/
|
||||
" match remaining two-char operators: := && || <- ++ --
|
||||
syn match goOperator /:=\|||\|<-\|++\|--/
|
||||
" match ~
|
||||
syn match goOperator /\~/
|
||||
" match ...
|
||||
|
||||
hi def link goPointerOperator goOperator
|
||||
@@ -277,14 +279,37 @@ if go#config#HighlightOperators()
|
||||
endif
|
||||
hi def link goOperator Operator
|
||||
|
||||
" -> type constraint opening bracket
|
||||
" |-> start non-counting group
|
||||
" || -> any word character
|
||||
" || | -> at least one, as many as possible
|
||||
" || | | -> start non-counting group
|
||||
" || | | | -> match ~
|
||||
" || | | | | -> at most once
|
||||
" || | | | | | -> allow a slice type
|
||||
" || | | | | | | -> any word character
|
||||
" || | | | | | | | -> start a non-counting group
|
||||
" || | | | | | | | | -> that matches word characters and |
|
||||
" || | | | | | | | | | -> close the non-counting group
|
||||
" || | | | | | | | | | | -> close the non-counting group
|
||||
" || | | | | | | | | | | |-> any number of matches
|
||||
" || | | | | | | | | | | || -> start a non-counting group
|
||||
" || | | | | | | | | | | || | -> a comma and whitespace
|
||||
" || | | | | | | | | | | || | | -> at most once
|
||||
" || | | | | | | | | | | || | | | -> close the non-counting group
|
||||
" || | | | | | | | | | | || | | | | -> at least one of those non-counting groups, as many as possible
|
||||
" || | | | | | -------- | | | | || | | | | | -> type constraint closing bracket
|
||||
" || | | | | || | | | | | || | | | | | |
|
||||
syn match goTypeParams /\[\%(\w\+\s\+\%(\~\?\%(\[]\)\?\w\%(\w\||\)\)*\%(,\s*\)\?\)\+\]/ nextgroup=goSimpleParams,goDeclType contained
|
||||
|
||||
" Functions;
|
||||
if go#config#HighlightFunctions() || go#config#HighlightFunctionParameters()
|
||||
syn match goDeclaration /\<func\>/ nextgroup=goReceiver,goFunction,goSimpleParams skipwhite skipnl
|
||||
syn match goReceiverDecl /(\s*\zs\%(\%(\w\+\s\+\)\?\*\?\w\+\)\ze\s*)/ contained contains=goReceiverVar,goReceiverType,goPointerOperator
|
||||
syn match goReceiverDecl /(\s*\zs\%(\%(\w\+\s\+\)\?\*\?\w\+\%(\[\%(\%(\[\]\)\?\w\+\%(,\s*\)\?\)\+\]\)\?\)\ze\s*)/ contained contains=goReceiverVar,goReceiverType,goPointerOperator
|
||||
syn match goReceiverVar /\w\+\ze\s\+\%(\w\|\*\)/ nextgroup=goPointerOperator,goReceiverType skipwhite skipnl contained
|
||||
syn match goPointerOperator /\*/ nextgroup=goReceiverType contained skipwhite skipnl
|
||||
syn match goFunction /\w\+/ nextgroup=goSimpleParams contained skipwhite skipnl
|
||||
syn match goReceiverType /\w\+\ze\s*)/ contained
|
||||
syn match goFunction /\w\+/ nextgroup=goSimpleParams,goTypeParams contained skipwhite skipnl
|
||||
syn match goReceiverType /\w\+\%(\[\%(\%(\[\]\)\?\w\+\%(,\s*\)\?\)\+\]\)\?\ze\s*)/ contained
|
||||
if go#config#HighlightFunctionParameters()
|
||||
syn match goSimpleParams /(\%(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goParamName,goType nextgroup=goFunctionReturn skipwhite skipnl
|
||||
syn match goFunctionReturn /(\%(\w\|\_s\|[*\.\[\],\{\}<>-]\)*)/ contained contains=goParamName,goType skipwhite skipnl
|
||||
@@ -294,7 +319,7 @@ if go#config#HighlightFunctions() || go#config#HighlightFunctionParameters()
|
||||
hi def link goReceiverVar goParamName
|
||||
hi def link goParamName Identifier
|
||||
endif
|
||||
syn match goReceiver /(\s*\%(\w\+\s\+\)\?\*\?\s*\w\+\s*)\ze\s*\w/ contained nextgroup=goFunction contains=goReceiverDecl skipwhite skipnl
|
||||
syn match goReceiver /(\s*\%(\w\+\s\+\)\?\*\?\s*\w\+\%(\[\%(\%(\[\]\)\?\w\+\%(,\s*\)\?\)\+\]\)\?\s*)\ze\s*\w/ contained nextgroup=goFunction contains=goReceiverDecl skipwhite skipnl
|
||||
else
|
||||
syn keyword goDeclaration func
|
||||
endif
|
||||
@@ -302,7 +327,7 @@ hi def link goFunction Function
|
||||
|
||||
" Function calls;
|
||||
if go#config#HighlightFunctionCalls()
|
||||
syn match goFunctionCall /\w\+\ze(/ contains=goBuiltins,goDeclaration
|
||||
syn match goFunctionCall /\w\+\ze\%(\[\%(\%(\[]\)\?\w\+\(,\s*\)\?\)\+\]\)\?(/ contains=goBuiltins,goDeclaration
|
||||
endif
|
||||
hi def link goFunctionCall Type
|
||||
|
||||
@@ -329,7 +354,7 @@ hi def link goField Identifier
|
||||
if go#config#HighlightTypes()
|
||||
syn match goTypeConstructor /\<\w\+{\@=/
|
||||
syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
|
||||
syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl
|
||||
syn match goTypeName /\w\+/ contained nextgroup=goDeclType,goTypeParams skipwhite skipnl
|
||||
syn match goDeclType /\<\%(interface\|struct\)\>/ skipwhite skipnl
|
||||
hi def link goReceiverType Type
|
||||
else
|
||||
|
||||
100
syntax/gowork.vim
Normal file
100
syntax/gowork.vim
Normal file
@@ -0,0 +1,100 @@
|
||||
if polyglot#init#is_disabled(expand('<sfile>:p'), 'go', 'syntax/gowork.vim')
|
||||
finish
|
||||
endif
|
||||
|
||||
" gowork.vim: Vim syntax file for go.work file
|
||||
"
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syntax case match
|
||||
|
||||
" Reference documentation:
|
||||
" https://go.dev/ref/mod#workspaces
|
||||
|
||||
" match keywords
|
||||
syntax keyword goworkGo go contained
|
||||
syntax keyword goworkUse use
|
||||
syntax keyword goworkExclude exclude
|
||||
syntax keyword goworkReplace replace
|
||||
syntax keyword goworkRetract retract
|
||||
|
||||
" require, exclude, replace, and go can be also grouped into block
|
||||
syntax region goworkUse start='require (' end=')' transparent contains=goworkUse,goworkPath
|
||||
syntax region goworkReplace start='replace (' end=')' transparent contains=goworkReplace,goworkVersion
|
||||
syntax match goworkGo '^go .*$' transparent contains=goworkGo,goworkGoVersion
|
||||
|
||||
" set highlights
|
||||
highlight default link goworkGo Keyword
|
||||
highlight default link goworkUse Keyword
|
||||
highlight default link goworkReplace Keyword
|
||||
|
||||
" comments are always in form of // ...
|
||||
syntax region goworkComment start="//" end="$" contains=@Spell
|
||||
highlight default link goworkComment Comment
|
||||
|
||||
" make sure quoted import paths are higlighted
|
||||
syntax region goworkString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
highlight default link goworkString String
|
||||
|
||||
" replace operator is in the form of '=>'
|
||||
syntax match goworkReplaceOperator "\v\=\>"
|
||||
highlight default link goworkReplaceOperator Operator
|
||||
|
||||
" match go versions
|
||||
syntax match goworkGoVersion "1\.\d\+" contained
|
||||
highlight default link goworkGoVersion Identifier
|
||||
|
||||
|
||||
" match paths in use directives
|
||||
syntax match goworkPath "\f\+"
|
||||
|
||||
highlight default link goworkPath Identifier
|
||||
" highlight versions:
|
||||
" * vX.Y.Z-pre
|
||||
" * vX.Y.Z
|
||||
" * vX.0.0-yyyyymmddhhmmss-abcdefabcdef
|
||||
" * vX.Y.Z-pre.0.yyyymmddhhmmss-abcdefabcdef
|
||||
" * vX.Y.(Z+1)-0.yyyymmddhhss-abcdefabcdef
|
||||
" see https://godoc.org/golang.org/x/tools/internal/semver for more
|
||||
" information about how semantic versions are parsed and
|
||||
" https://golang.org/cmd/go/ for how pseudo-versions and +incompatible
|
||||
" are applied.
|
||||
|
||||
|
||||
" match vX.Y.Z and their prereleases
|
||||
syntax match goworkVersion "v\d\+\.\d\+\.\d\+\%(-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?"
|
||||
" ^--- version ---^^------------ pre-release ---------------------^^--------------- metadata ---------------------^
|
||||
" ^--------------------------------------- semantic version -------------------------------------------------------^
|
||||
|
||||
" match pseudo versions
|
||||
" without a major version before the commit (e.g. vX.0.0-yyyymmddhhmmss-abcdefabcdef)
|
||||
syntax match goworkVersion "v\d\+\.0\.0-\d\{14\}-\x\+"
|
||||
" when most recent version before target is a pre-release
|
||||
syntax match goworkVersion "v\d\+\.\d\+\.\d\+-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?\.0\.\d\{14}-\x\+"
|
||||
" ^--- version ---^^--- ------ pre-release -----------------^^--------------- metadata ---------------------^
|
||||
" ^------------------------------------- semantic version --------------------------------------------------^
|
||||
" most recent version before the target is X.Y.Z
|
||||
syntax match goworkVersion "v\d\+\.\d\+\.\d\+\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?-0\.\d\{14}-\x\+"
|
||||
" ^--- version ---^^--------------- metadata ---------------------^
|
||||
|
||||
" match incompatible vX.Y.Z and their prereleases
|
||||
syntax match goworkVersion "v[2-9]\{1}\d*\.\d\+\.\d\+\%(-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?+incompatible"
|
||||
" ^------- version -------^^------------- pre-release ---------------------^^--------------- metadata ---------------------^
|
||||
" ^------------------------------------------- semantic version -----------------------------------------------------------^
|
||||
|
||||
" match incompatible pseudo versions
|
||||
" incompatible without a major version before the commit (e.g. vX.0.0-yyyymmddhhmmss-abcdefabcdef)
|
||||
syntax match goworkVersion "v[2-9]\{1}\d*\.0\.0-\d\{14\}-\x\++incompatible"
|
||||
" when most recent version before target is a pre-release
|
||||
syntax match goworkVersion "v[2-9]\{1}\d*\.\d\+\.\d\+-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?\.0\.\d\{14}-\x\++incompatible"
|
||||
" ^------- version -------^^---------- pre-release -----------------^^--------------- metadata ---------------------^
|
||||
" ^---------------------------------------- semantic version ------------------------------------------------------^
|
||||
" most recent version before the target is X.Y.Z
|
||||
syntax match goworkVersion "v[2-9]\{1}\d*\.\d\+\.\d\+\%(+\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?-0\.\d\{14}-\x\++incompatible"
|
||||
" ^------- version -------^^---------------- metadata ---------------------^
|
||||
highlight default link goworkVersion Identifier
|
||||
|
||||
let b:current_syntax = "gowork"
|
||||
@@ -120,6 +120,7 @@ syn keyword mesonBuiltin
|
||||
\ shared_library
|
||||
\ shared_module
|
||||
\ static_library
|
||||
\ structured_sources
|
||||
\ subdir
|
||||
\ subdir_done
|
||||
\ subproject
|
||||
@@ -130,6 +131,7 @@ syn keyword mesonBuiltin
|
||||
\ vcs_tag
|
||||
\ warning
|
||||
\ range
|
||||
\ debug
|
||||
|
||||
if exists("meson_space_error_highlight")
|
||||
" trailing whitespace
|
||||
|
||||
@@ -271,6 +271,15 @@ silent! syntax clear htmlHead
|
||||
syntax match javaScriptNumber '\v<-?\d+L?>|0[xX][0-9a-fA-F]+>'
|
||||
\ containedin=@javascriptSvelteScript display
|
||||
|
||||
" TypeScript
|
||||
" Fix template string `...` breaking syntax highlighting
|
||||
syntax region typescriptTemplate
|
||||
\ start=/`/ skip=/\\\\\|\\`\|\n/ end=/`\|$/
|
||||
\ contains=typescriptTemplateSubstitution,typescriptSpecial,@Spell
|
||||
\ containedin=typescriptObjectLiteral
|
||||
\ nextgroup=@typescriptSymbols
|
||||
\ skipwhite skipempty
|
||||
|
||||
" html5 data-*
|
||||
syntax match htmlArg '\v<data(-[.a-z0-9]+)+>' containedin=@HTMLSyntax
|
||||
"}}}
|
||||
|
||||
165
syntax/tmux.vim
165
syntax/tmux.vim
@@ -3,7 +3,7 @@ if polyglot#init#is_disabled(expand('<sfile>:p'), 'tmux', 'syntax/tmux.vim')
|
||||
endif
|
||||
|
||||
" Language: tmux(1) configuration file
|
||||
" Version: 3.3-rc (git-ee3f1d25)
|
||||
" Version: 3.3-rc (git-8bcd392e)
|
||||
" URL: https://github.com/ericpruitt/tmux.vim/
|
||||
" Maintainer: Eric Pruitt <eric.pruitt@gmail.com>
|
||||
" License: 2-Clause BSD (http://opensource.org/licenses/BSD-2-Clause)
|
||||
@@ -21,41 +21,62 @@ let b:current_syntax = "tmux"
|
||||
syntax iskeyword @,48-57,_,192-255,-
|
||||
syntax case match
|
||||
|
||||
syn keyword tmuxAction none any current other
|
||||
syn keyword tmuxBoolean off on
|
||||
" The values "yes" and "no" are synonyms for "on" and "off", so they do not
|
||||
" appear in the option table file.
|
||||
syn keyword tmuxEnums yes no
|
||||
|
||||
syn keyword tmuxTodo FIXME NOTE TODO XXX contained
|
||||
|
||||
syn match tmuxColour /\<colour[0-9]\+/ display
|
||||
syn match tmuxColour /\<colou\?r[0-9]\+\>/ display
|
||||
syn match tmuxKey /\(C-\|M-\|\^\)\+\S\+/ display
|
||||
syn match tmuxNumber /\<\d\+\>/ display
|
||||
syn match tmuxFlags /\s-\a\+/ display
|
||||
syn match tmuxVariable /\w\+=/ display
|
||||
syn match tmuxVariableExpansion /\${\=\w\+}\=/ display
|
||||
syn match tmuxControl /%\(if\|elif\|else\|endif\)/
|
||||
syn match tmuxVariableExpansion /\$\({[A-Za-z_]\w*}\|[A-Za-z_]\w*\)/ display
|
||||
syn match tmuxControl /\(^\|\s\)%\(if\|elif\|else\|endif\)\($\|\s\)/ display
|
||||
syn match tmuxEscape /\\\(u\x\{4\}\|U\x\{8\}\|\o\{3\}\|[\\ernt$]\)/ display
|
||||
|
||||
" Missing closing bracket.
|
||||
syn match tmuxInvalidVariableExpansion /\${[^}]*$/ display
|
||||
" Starts with invalid character.
|
||||
syn match tmuxInvalidVariableExpansion /\${[^A-Za-z_][^}]*}/ display
|
||||
syn match tmuxInvalidVariableExpansion /\$[^A-Za-z_{ \t]/ display
|
||||
" Contains invalid character.
|
||||
syn match tmuxInvalidVariableExpansion /\${[^}]*[^A-Za-z0-9_][^}]*}/ display
|
||||
|
||||
syn region tmuxComment start=/#/ skip=/\\\@<!\\$/ end=/$/ contains=tmuxTodo,@Spell
|
||||
|
||||
syn region tmuxString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=tmuxFormatString,@Spell
|
||||
syn region tmuxString start=+'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end='$' contains=tmuxFormatString,@Spell
|
||||
syn region tmuxString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=tmuxFormatString,tmuxEscape,tmuxVariableExpansion,tmuxInvalidVariableExpansion,@Spell
|
||||
syn region tmuxUninterpolatedString start=+'+ skip=+\\$+ excludenl end=+'+ end='$' contains=tmuxFormatString,@Spell
|
||||
|
||||
" TODO: Figure out how escaping works inside of #(...) and #{...} blocks.
|
||||
syn region tmuxFormatString start=/#[#DFhHIPSTW]/ end=// contained keepend
|
||||
syn region tmuxFormatString start=/#{/ skip=/#{.\{-}}/ end=/}/ keepend
|
||||
syn region tmuxFormatString start=/#(/ skip=/#(.\{-})/ end=/)/ contained keepend
|
||||
|
||||
" At the time of this writing, the latest tmux release will parse a line
|
||||
" reading "abc=xyz set-option ..." as an assignment followed by a command
|
||||
" hence the presence of "\s" in the "end" argument.
|
||||
syn region tmuxAssignment matchgroup=tmuxVariable start=/^\s*[A-Za-z_]\w*=\@=/ skip=/\\$\|\\\s/ end=/\s\|$/ contains=tmuxString,tmuxUninterpolatedString,tmuxVariableExpansion,tmuxControl,tmuxEscape,tmuxInvalidVariableExpansion
|
||||
|
||||
hi def link tmuxFormatString Identifier
|
||||
hi def link tmuxAction Boolean
|
||||
hi def link tmuxBoolean Boolean
|
||||
hi def link tmuxCommands Keyword
|
||||
hi def link tmuxControl Keyword
|
||||
hi def link tmuxControl PreCondit
|
||||
hi def link tmuxComment Comment
|
||||
hi def link tmuxEnums Boolean
|
||||
hi def link tmuxEscape Special
|
||||
hi def link tmuxEscapeUnquoted Special
|
||||
hi def link tmuxInvalidVariableExpansion
|
||||
\ Error
|
||||
hi def link tmuxKey Special
|
||||
hi def link tmuxNumber Number
|
||||
hi def link tmuxFlags Identifier
|
||||
hi def link tmuxOptions Function
|
||||
hi def link tmuxString String
|
||||
hi def link tmuxTodo Todo
|
||||
hi def link tmuxUninterpolatedString
|
||||
\ String
|
||||
hi def link tmuxVariable Identifier
|
||||
hi def link tmuxVariableExpansion Identifier
|
||||
|
||||
@@ -65,66 +86,90 @@ hi def link tmuxVariableExpansion Identifier
|
||||
if get(g:, "tmux_syntax_colors", 1)
|
||||
for s:i in range(0, 255)
|
||||
let s:bg = (!s:i || s:i == 16 || (s:i > 231 && s:i < 235)) ? 15 : "none"
|
||||
exec "syn match tmuxColour" . s:i . " /\\<colour" . s:i . "\\>/ display"
|
||||
exec "syn match tmuxColour" . s:i . " /\\<colou\\?r" . s:i . "\\>/ display"
|
||||
\ " | highlight tmuxColour" . s:i . " ctermfg=" . s:i . " ctermbg=" . s:bg
|
||||
endfor
|
||||
endif
|
||||
|
||||
syn keyword tmuxOptions
|
||||
\ backspace buffer-limit command-alias copy-command cursor-colour
|
||||
\ cursor-style default-terminal editor escape-time activity-action
|
||||
\ assume-paste-time base-index bell-action default-command default-shell
|
||||
\ default-size destroy-unattached detach-on-destroy
|
||||
\ display-panes-active-colour display-panes-colour display-panes-time
|
||||
\ display-time exit-empty exit-unattached extended-keys focus-events
|
||||
\ activity-action after-bind-key after-capture-pane after-copy-mode
|
||||
\ after-display-message after-display-panes after-kill-pane after-list-buffers
|
||||
\ after-list-clients after-list-keys after-list-panes after-list-sessions
|
||||
\ after-list-windows after-load-buffer after-lock-server after-new-session
|
||||
\ after-new-window after-paste-buffer after-pipe-pane after-queue
|
||||
\ after-refresh-client after-rename-session after-rename-window
|
||||
\ after-resize-pane after-resize-window after-save-buffer after-select-layout
|
||||
\ after-select-pane after-select-window after-send-keys after-set-buffer
|
||||
\ after-set-environment after-set-hook after-set-option after-show-environment
|
||||
\ after-show-messages after-show-options after-split-window after-unbind-key
|
||||
\ aggressive-resize alert-activity alert-bell alert-silence allow-passthrough
|
||||
\ allow-rename alternate-screen assume-paste-time automatic-rename
|
||||
\ automatic-rename-format backspace base-index bell-action buffer-limit
|
||||
\ client-active client-attached client-detached client-focus-in
|
||||
\ client-focus-out client-resized client-session-changed clock-mode-color
|
||||
\ clock-mode-colour clock-mode-style command-alias copy-command
|
||||
\ copy-mode-current-match-style copy-mode-mark-style copy-mode-match-style
|
||||
\ cursor-color cursor-colour cursor-style default-command default-shell
|
||||
\ default-size default-terminal destroy-unattached detach-on-destroy
|
||||
\ display-panes-active-color display-panes-active-colour display-panes-color
|
||||
\ display-panes-colour display-panes-time display-time editor escape-time
|
||||
\ exit-empty exit-unattached extended-keys fill-character focus-events
|
||||
\ history-file history-limit key-table lock-after-time lock-command
|
||||
\ message-command-style message-limit aggressive-resize allow-passthrough
|
||||
\ allow-rename alternate-screen automatic-rename automatic-rename-format
|
||||
\ clock-mode-colour clock-mode-style copy-mode-current-match-style
|
||||
\ copy-mode-mark-style copy-mode-match-style main-pane-height
|
||||
\ main-pane-width message-style mode-keys mode-style monitor-activity
|
||||
\ monitor-bell monitor-silence mouse other-pane-height other-pane-width
|
||||
\ main-pane-height main-pane-width message-command-style message-limit
|
||||
\ message-style mode-keys mode-style monitor-activity monitor-bell
|
||||
\ monitor-silence mouse other-pane-height other-pane-width
|
||||
\ pane-active-border-style pane-base-index pane-border-format
|
||||
\ pane-border-indicators pane-border-lines pane-border-status
|
||||
\ pane-border-style pane-colours popup-border-lines popup-border-style
|
||||
\ popup-style prefix prefix2 prompt-history-limit remain-on-exit
|
||||
\ remain-on-exit-format renumber-windows repeat-time set-clipboard
|
||||
\ set-titles set-titles-string silence-action status status-bg status-fg
|
||||
\ status-format status-interval status-justify status-keys status-left
|
||||
\ status-left-length status-left-style status-position status-right
|
||||
\ status-right-length status-right-style status-style synchronize-panes
|
||||
\ terminal-features terminal-overrides update-environment user-keys
|
||||
\ visual-activity visual-bell visual-silence window-active-style window-size
|
||||
\ window-status-activity-style window-status-bell-style
|
||||
\ window-status-current-format window-status-current-style
|
||||
\ window-status-format window-status-last-style window-status-separator
|
||||
\ window-status-style window-style word-separators wrap-search
|
||||
\ pane-border-indicators pane-border-lines pane-border-status pane-border-style
|
||||
\ pane-colors pane-colours pane-died pane-exited pane-focus-in pane-focus-out
|
||||
\ pane-mode-changed pane-set-clipboard pane-title-changed popup-border-lines
|
||||
\ popup-border-style popup-style prefix prefix2 prompt-history-limit
|
||||
\ remain-on-exit remain-on-exit-format renumber-windows repeat-time
|
||||
\ scroll-on-clear session-closed session-created session-renamed
|
||||
\ session-window-changed set-clipboard set-titles set-titles-string
|
||||
\ silence-action status status-bg status-fg status-format status-interval
|
||||
\ status-justify status-keys status-left status-left-length status-left-style
|
||||
\ status-position status-right status-right-length status-right-style
|
||||
\ status-style synchronize-panes terminal-features terminal-overrides
|
||||
\ update-environment user-keys visual-activity visual-bell visual-silence
|
||||
\ window-active-style window-layout-changed window-linked window-pane-changed
|
||||
\ window-renamed window-resized window-size window-status-activity-style
|
||||
\ window-status-bell-style window-status-current-format
|
||||
\ window-status-current-style window-status-format window-status-last-style
|
||||
\ window-status-separator window-status-style window-style window-unlinked
|
||||
\ word-separators wrap-search xterm-keys
|
||||
|
||||
syn keyword tmuxCommands
|
||||
\ attach attach-session bind bind-key break-pane breakp capture-pane
|
||||
\ capturep choose-buffer choose-client choose-tree clear-history clearhist
|
||||
\ clock-mode command-prompt confirm confirm-before copy-mode customize-mode
|
||||
\ detach detach-client display display-menu display-message display-panes
|
||||
\ display-popup displayp find-window findw if if-shell join-pane joinp
|
||||
\ kill-pane kill-server kill-session kill-window killp has has-session killw
|
||||
\ link-window linkw list-buffers list-clients list-commands list-keys
|
||||
\ list-panes list-sessions list-windows load-buffer loadb lock lock-client
|
||||
\ lock-server lock-session lockc last-pane lastp locks ls last last-window
|
||||
\ lsb delete-buffer deleteb lsc lscm lsk lsp lsw menu move-pane move-window
|
||||
\ clear-prompt-history clearphist movep movew new new-session new-window
|
||||
\ neww next next-layout next-window nextl paste-buffer pasteb pipe-pane
|
||||
\ pipep popup prev previous-layout previous-window prevl refresh
|
||||
\ refresh-client rename rename-session rename-window renamew resize-pane
|
||||
\ resize-window resizep resizew respawn-pane respawn-window respawnp
|
||||
\ respawnw rotate-window rotatew run run-shell save-buffer saveb
|
||||
\ attach attach-session bind bind-key break-pane breakp capture-pane capturep
|
||||
\ choose-buffer choose-client choose-session choose-tree choose-window
|
||||
\ clear-history clear-prompt-history clearhist clearphist clock-mode
|
||||
\ command-prompt confirm confirm-before copy-mode customize-mode delete-buffer
|
||||
\ deleteb detach detach-client display display-menu display-message
|
||||
\ display-panes display-popup displayp find-window findw has has-session if
|
||||
\ if-shell info join-pane joinp kill-pane kill-server kill-session kill-window
|
||||
\ killp killw last last-pane last-window lastp link-window linkw list-buffers
|
||||
\ list-clients list-commands list-keys list-panes list-sessions list-windows
|
||||
\ load-buffer loadb lock lock-client lock-server lock-session lockc locks ls
|
||||
\ lsb lsc lscm lsk lsp lsw menu move-pane move-window movep movew new
|
||||
\ new-session new-window neww next next-layout next-window nextl paste-buffer
|
||||
\ pasteb pipe-pane pipep popup prev previous-layout previous-window prevl
|
||||
\ refresh refresh-client rename rename-session rename-window renamew
|
||||
\ resize-pane resize-window resizep resizew respawn-pane respawn-window
|
||||
\ respawnp respawnw rotate-window rotatew run run-shell save-buffer saveb
|
||||
\ select-layout select-pane select-window selectl selectp selectw send
|
||||
\ send-keys send-prefix set set-buffer set-environment set-hook set-option
|
||||
\ set-window-option setb setenv setw show show-buffer show-environment
|
||||
\ show-hooks show-messages show-options show-prompt-history
|
||||
\ show-window-options showb showenv showmsgs showphist showw source
|
||||
\ source-file split-window splitw start start-server suspend-client suspendc
|
||||
\ swap-pane swap-window swapp swapw switch-client switchc unbind unbind-key
|
||||
\ unlink-window unlinkw wait wait-for
|
||||
\ send-keys send-prefix server-access server-info set set-buffer
|
||||
\ set-environment set-hook set-option set-window-option setb setenv setw show
|
||||
\ show-buffer show-environment show-hooks show-messages show-options
|
||||
\ show-prompt-history show-window-options showb showenv showmsgs showphist
|
||||
\ showw source source-file split-pane split-window splitp splitw start
|
||||
\ start-server suspend-client suspendc swap-pane swap-window swapp swapw
|
||||
\ switch-client switchc unbind unbind-key unlink-window unlinkw wait wait-for
|
||||
|
||||
syn keyword tmuxEnums
|
||||
\ absolute-centre always any arrows bar blinking-bar blinking-block
|
||||
\ blinking-underline block both bottom centre color colour current default
|
||||
\ double emacs external failed heavy largest latest left manual no-detached
|
||||
\ none number off on other padded right rounded simple single smallest top
|
||||
\ underline vi
|
||||
|
||||
let &cpo = s:original_cpo
|
||||
unlet! s:original_cpo s:bg s:i
|
||||
|
||||
@@ -119,6 +119,7 @@ let s:zig_syntax_keywords = {
|
||||
\ , "@divTrunc"
|
||||
\ , "@embedFile"
|
||||
\ , "@export"
|
||||
\ , "@extern"
|
||||
\ , "@tagName"
|
||||
\ , "@TagType"
|
||||
\ , "@errorName"
|
||||
|
||||
Reference in New Issue
Block a user