mirror of
https://github.com/sheerun/vim-polyglot.git
synced 2025-11-09 20:13:51 -05:00
Update
This commit is contained in:
@@ -89,7 +89,7 @@ let g:crystal#indent#non_bracket_continuation_regex =
|
|||||||
\ '\|' .
|
\ '\|' .
|
||||||
\ '\%(\%(\<do\>\|%\@1<!{\)\s*|[^|]*\)\@<!|' .
|
\ '\%(\%(\<do\>\|%\@1<!{\)\s*|[^|]*\)\@<!|' .
|
||||||
\ '\|' .
|
\ '\|' .
|
||||||
\ '\W?' .
|
\ '\%(]\|\w\)\@1<!?' .
|
||||||
\ '\|' .
|
\ '\|' .
|
||||||
\ '\<\%(if\|unless\)\>' .
|
\ '\<\%(if\|unless\)\>' .
|
||||||
\ '\|' .
|
\ '\|' .
|
||||||
|
|||||||
@@ -553,7 +553,7 @@ function! go#config#DiagnosticsEnabled() abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! go#config#GoplsOptions() abort
|
function! go#config#GoplsOptions() abort
|
||||||
return get(g:, 'go_gopls_options', [])
|
return get(g:, 'go_gopls_options', ['-remote=auto'])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" Set the default value. A value of "1" is a shortcut for this, for
|
" Set the default value. A value of "1" is a shortcut for this, for
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ let b:julia_vim_loaded = 1
|
|||||||
|
|
||||||
let b:undo_ftplugin = "setlocal include< suffixesadd< comments< commentstring<"
|
let b:undo_ftplugin = "setlocal include< suffixesadd< comments< commentstring<"
|
||||||
\ . " define< fo< shiftwidth< expandtab< indentexpr< indentkeys< cinoptions< omnifunc<"
|
\ . " define< fo< shiftwidth< expandtab< indentexpr< indentkeys< cinoptions< omnifunc<"
|
||||||
|
\ . " | unlet! b:commentary_format"
|
||||||
|
\ . " | unlet! b:smartcomment_force_linemode"
|
||||||
\ . " | unlet! b:julia_vim_loaded"
|
\ . " | unlet! b:julia_vim_loaded"
|
||||||
|
|
||||||
" MatchIt plugin support
|
" MatchIt plugin support
|
||||||
@@ -94,6 +96,10 @@ if exists("loaded_matchit")
|
|||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Some plugin-specific tweaks for commenting
|
||||||
|
let b:commentary_format = "# %s" " for tpope/vim-commentary
|
||||||
|
let b:smartcomment_force_linemode = 1 " for carlobaldassi/vim-smartcomment
|
||||||
|
|
||||||
if has("gui_win32")
|
if has("gui_win32")
|
||||||
let b:browsefilter = "Julia Source Files (*.jl)\t*.jl\n"
|
let b:browsefilter = "Julia Source Files (*.jl)\t*.jl\n"
|
||||||
let b:undo_ftplugin = b:undo_ftplugin . " | unlet! b:browsefilter"
|
let b:undo_ftplugin = b:undo_ftplugin . " | unlet! b:browsefilter"
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ setlocal nolisp
|
|||||||
setlocal autoindent
|
setlocal autoindent
|
||||||
setlocal indentexpr=VlangIndent(v:lnum)
|
setlocal indentexpr=VlangIndent(v:lnum)
|
||||||
setlocal indentkeys+=<:>,0=},0=)
|
setlocal indentkeys+=<:>,0=},0=)
|
||||||
|
setlocal noexpandtab
|
||||||
|
|
||||||
if exists("*VlangIndent")
|
if exists("*VlangIndent")
|
||||||
finish
|
finish
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, 'jenkins') == -1
|
|||||||
runtime syntax/groovy.vim
|
runtime syntax/groovy.vim
|
||||||
syn keyword jenkinsfileBuiltInVariable currentBuild
|
syn keyword jenkinsfileBuiltInVariable currentBuild
|
||||||
|
|
||||||
syn keyword jenkinsfileSection pipeline agent stages steps
|
syn keyword jenkinsfileSection pipeline agent stages steps post
|
||||||
|
|
||||||
syn keyword jenkinsfileDirective environment options parameters triggers stage tools input when libraries
|
syn keyword jenkinsfileDirective environment options parameters triggers stage tools input when libraries
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ syn region jenkinsfileOptionParams contained start='(' end=')' transparent cont
|
|||||||
syn match jenkinsfileOptionO /[a-zA-Z]\+([^)]*)/ contains=jenkinsfileOption,jenkinsfileOptionParams transparent containedin=groovyParenT1
|
syn match jenkinsfileOptionO /[a-zA-Z]\+([^)]*)/ contains=jenkinsfileOption,jenkinsfileOptionParams transparent containedin=groovyParenT1
|
||||||
|
|
||||||
syn keyword jenkinsfileCoreStep checkout
|
syn keyword jenkinsfileCoreStep checkout
|
||||||
syn keyword jenkinsfileCoreStep docker skipwhite nextgroup=jenkinsFileDockerConfigBlock
|
syn keyword jenkinsfileCoreStep docker dockerfile skipwhite nextgroup=jenkinsFileDockerConfigBlock
|
||||||
syn keyword jenkinsfileCoreStep node
|
syn keyword jenkinsfileCoreStep node
|
||||||
syn keyword jenkinsfileCoreStep scm
|
syn keyword jenkinsfileCoreStep scm
|
||||||
syn keyword jenkinsfileCoreStep sh
|
syn keyword jenkinsfileCoreStep sh
|
||||||
@@ -24,10 +24,10 @@ syn keyword jenkinsfileCoreStep step
|
|||||||
syn keyword jenkinsfileCoreStep tool
|
syn keyword jenkinsfileCoreStep tool
|
||||||
|
|
||||||
" TODO: These should probably be broken out.
|
" TODO: These should probably be broken out.
|
||||||
syn keyword jenkinsfileCoreStep post always changed failure success unstable aborted
|
syn keyword jenkinsfileCoreStep always changed failure success unstable aborted unsuccessful regression fixed cleanup
|
||||||
|
|
||||||
syn region jenkinsFileDockerConfigBlock contained start='{' end='}' contains=groovyString,jenkinsfileDockerKeyword transparent
|
syn region jenkinsFileDockerConfigBlock contained start='{' end='}' contains=groovyString,jenkinsfileDockerKeyword transparent
|
||||||
syn keyword jenkinsFileDockerKeyword contained image args dockerfile additionalBuildArgs
|
syn keyword jenkinsFileDockerKeyword contained image args additionalBuildArgs label registryUrl registryCredentialsId alwaysPull filename dir
|
||||||
|
|
||||||
syn keyword jenkinsfilePipelineStep Applitools ArtifactoryGradleBuild Consul MavenDescriptorStep OneSky VersionNumber
|
syn keyword jenkinsfilePipelineStep Applitools ArtifactoryGradleBuild Consul MavenDescriptorStep OneSky VersionNumber
|
||||||
syn keyword jenkinsfilePipelineStep ViolationsToBitbucketServer ViolationsToGitHub ViolationsToGitLab _OcAction _OcContextInit
|
syn keyword jenkinsfilePipelineStep ViolationsToBitbucketServer ViolationsToGitHub ViolationsToGitLab _OcAction _OcContextInit
|
||||||
@@ -112,8 +112,8 @@ syn keyword jenkinsfilePipelineStep walk waptProReport warnings whitesource winR
|
|||||||
syn keyword jenkinsfilePipelineStep withCredentials withDockerContainer withDockerRegistry withDockerServer withEnv withKafkaLog
|
syn keyword jenkinsfilePipelineStep withCredentials withDockerContainer withDockerRegistry withDockerServer withEnv withKafkaLog
|
||||||
syn keyword jenkinsfilePipelineStep withKubeConfig withMaven withNPM withPod withPythonEnv withSCM withSandbox withSonarQubeEnv
|
syn keyword jenkinsfilePipelineStep withKubeConfig withMaven withNPM withPod withPythonEnv withSCM withSandbox withSonarQubeEnv
|
||||||
syn keyword jenkinsfilePipelineStep withTypetalk wrap writeFile writeJSON writeMavenPom writeProperties writeXml writeYaml
|
syn keyword jenkinsfilePipelineStep withTypetalk wrap writeFile writeJSON writeMavenPom writeProperties writeXml writeYaml
|
||||||
syn keyword jenkinsfilePipelineStep ws xUnitImporter xUnitUploader xldCreatePackage xldDeploy xldPublishPackage xlrCreateRelease
|
syn keyword jenkinsfilePipelineStep ws xUnitImporter xUnitUploader xunit xldCreatePackage xldDeploy xldPublishPackage
|
||||||
syn keyword jenkinsfilePipelineStep xrayScanBuild zip
|
syn keyword jenkinsfilePipelineStep xlrCreateRelease xrayScanBuild zip
|
||||||
|
|
||||||
hi link jenkinsfileSection Statement
|
hi link jenkinsfileSection Statement
|
||||||
hi link jenkinsfileDirective jenkinsfileSection
|
hi link jenkinsfileDirective jenkinsfileSection
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ syn match ps1Type /\[[a-z_][a-z0-9_.,\[\]]\+\]/
|
|||||||
" Variable references
|
" Variable references
|
||||||
syn match ps1ScopeModifier /\(global:\|local:\|private:\|script:\)/ contained
|
syn match ps1ScopeModifier /\(global:\|local:\|private:\|script:\)/ contained
|
||||||
syn match ps1Variable /\$\w\+\(:\w\+\)\?/ contains=ps1ScopeModifier
|
syn match ps1Variable /\$\w\+\(:\w\+\)\?/ contains=ps1ScopeModifier
|
||||||
syn match ps1Variable /\${\w\+\(:\w\+\)\?}/ contains=ps1ScopeModifier
|
syn match ps1Variable /\${\w\+\(:\?[[:alnum:]_()]\+\)\?}/ contains=ps1ScopeModifier
|
||||||
|
|
||||||
" Operators
|
" Operators
|
||||||
syn keyword ps1Operator -eq -ne -ge -gt -lt -le -like -notlike -match -notmatch -replace -split -contains -notcontains
|
syn keyword ps1Operator -eq -ne -ge -gt -lt -le -like -notlike -match -notmatch -replace -split -contains -notcontains
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ function! s:enabled(language)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Default tag definitions.
|
||||||
let s:languages = [
|
let s:languages = [
|
||||||
\ { 'name': 'less', 'tag': 'style' },
|
\ { 'name': 'less', 'tag': 'style' },
|
||||||
\ { 'name': 'scss', 'tag': 'style' },
|
\ { 'name': 'scss', 'tag': 'style' },
|
||||||
@@ -94,12 +95,17 @@ let s:languages = [
|
|||||||
\ { 'name': 'typescript', 'tag': 'script' },
|
\ { 'name': 'typescript', 'tag': 'script' },
|
||||||
\ ]
|
\ ]
|
||||||
|
|
||||||
|
" Add global tag definitions to our defaults.
|
||||||
|
if exists('g:svelte_preprocessor_tags') && type('g:svelte_preprocessor_tags') == v:t_list
|
||||||
|
let s:languages += g:svelte_preprocessor_tags
|
||||||
|
endif
|
||||||
|
|
||||||
for s:language in s:languages
|
for s:language in s:languages
|
||||||
let s:attr = '\(lang\|type\)=\("\|''\)[^\2]*' . s:language.name . '[^\2]*\2'
|
let s:attr = '\(lang\|type\)=\("\|''\)[^\2]*' . s:language.name . '[^\2]*\2'
|
||||||
let s:start = '<' . s:language.tag . '\>\_[^>]*' . s:attr . '\_[^>]*>'
|
let s:start = '<' . s:language.tag . '\>\_[^>]*' . s:attr . '\_[^>]*>'
|
||||||
|
|
||||||
if s:enabled(s:language.name)
|
if s:enabled(s:language.name)
|
||||||
execute 'syntax include @' . s:language.name . ' syntax/' . s:language.name . '.vim'
|
execute 'syntax include @' . s:language.name . ' syntax/' . get(s:language, 'as', s:language.name) . '.vim'
|
||||||
unlet! b:current_syntax
|
unlet! b:current_syntax
|
||||||
|
|
||||||
execute 'syntax region svelte_' . s:language.name
|
execute 'syntax region svelte_' . s:language.name
|
||||||
|
|||||||
250
syntax/vlang.vim
250
syntax/vlang.vim
@@ -51,189 +51,191 @@ endif
|
|||||||
|
|
||||||
syn case match
|
syn case match
|
||||||
|
|
||||||
syn match vDeclType "\<\(struct\|interface\)\>"
|
syn match vDeclType "\<\(struct\|interface\|type\|enum\)\>"
|
||||||
|
syn keyword vDeclaration pub mut var const
|
||||||
|
hi def link vDeclType Keyword
|
||||||
|
hi def link vDeclaration Keyword
|
||||||
|
|
||||||
syn keyword vDirective module import
|
syn keyword vDirective module import
|
||||||
syn keyword vDeclaration pub mut const type enum
|
hi def link vDirective Statement
|
||||||
syn region vIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
|
|
||||||
syn match vIncluded display contained "<[^>]*>"
|
|
||||||
syn match vFlagDefinition display contained "\s\i[^\n]*"
|
|
||||||
syn match vInclude display "^\s*\zs\(%:\|#\)\s*include\>\s*["<]" contains=vIncluded
|
|
||||||
syn match vFlag display "^\s*\zs\(%:\|#\)\s*flag\>\s*[^\n]*" contains=vFlagDefinition
|
|
||||||
syn region vShebang display start=/^#!/ end=/$/
|
|
||||||
|
|
||||||
hi def link vDirective Statement
|
syn region vIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||||
hi def link vDeclaration Keyword
|
syn match vIncluded display contained "<[^>]*>"
|
||||||
hi def link vDeclType Keyword
|
syn match vFlagDefinition display contained "\s\i[^\n]*"
|
||||||
hi def link vInclude Include
|
hi def link vIncluded vString
|
||||||
hi def link vFlag Include
|
hi def link vFlagDefinition vString
|
||||||
hi def link vIncluded vString
|
|
||||||
hi def link vFlagDefinition vString
|
syn match vInclude display "^\s*\zs\(%:\|#\)\s*include\>\s*["<]" contains=vIncluded
|
||||||
hi def link vShebang Include
|
syn match vFlag display "^\s*\zs\(%:\|#\)\s*flag\>\s*[^\n]*" contains=vFlagDefinition
|
||||||
|
syn region vShebang display start=/^#!/ end=/$/
|
||||||
|
hi def link vInclude Include
|
||||||
|
hi def link vFlag Include
|
||||||
|
hi def link vShebang Include
|
||||||
|
|
||||||
" Keywords within functions
|
" Keywords within functions
|
||||||
syn keyword vStatement defer go goto return break continue fallthrough
|
syn keyword vStatement defer go goto return break continue
|
||||||
syn keyword vConditional if else switch match or
|
hi def link vStatement Statement
|
||||||
syn keyword vLabel case default
|
|
||||||
syn keyword vRepeat for in
|
|
||||||
syn match vCodeGen /$if\>/
|
|
||||||
syn match vCodeGen /\.fields\>/
|
|
||||||
syn match vCodeGen /\.$\i*\>/
|
|
||||||
|
|
||||||
hi def link vStatement Statement
|
syn keyword vConditional if else match or
|
||||||
hi def link vConditional Conditional
|
hi def link vConditional Conditional
|
||||||
hi def link vLabel Label
|
|
||||||
hi def link vRepeat Repeat
|
syn keyword vRepeat for in
|
||||||
hi def link vCodeGen Identifier
|
hi def link vRepeat Repeat
|
||||||
|
|
||||||
|
syn match vCodeGen /$if\>/
|
||||||
|
" XXX Enable when compile-time code-gen is implemented in V
|
||||||
|
" syn match vCodeGen /\.fields\>/
|
||||||
|
" syn match vCodeGen /\.$\i*\>/
|
||||||
|
hi def link vCodeGen Identifier
|
||||||
|
|
||||||
" Predefined types
|
" Predefined types
|
||||||
syn keyword vType chan map bool string error voidptr
|
syn keyword vType chan map bool string error voidptr
|
||||||
syn keyword vSignedInts int i8 i16 i32 i64 rune intptr
|
syn keyword vSignedInts int i8 i16 i64 rune intptr
|
||||||
syn keyword vUnsignedInts byte uint u8 u16 u32 u64 byteptr
|
syn keyword vUnsignedInts byte u16 u32 u64 byteptr
|
||||||
syn keyword vFloats f32 f64 floatptr
|
syn keyword vFloats f32 f64 floatptr
|
||||||
syn keyword vComplexes complex64 complex128
|
" XXX Enable when complex numbers are implemented in V
|
||||||
|
" syn keyword vComplexes complex64 complex128
|
||||||
|
|
||||||
hi def link vType Type
|
hi def link vType Type
|
||||||
hi def link vSignedInts Type
|
hi def link vSignedInts Type
|
||||||
hi def link vUnsignedInts Type
|
hi def link vUnsignedInts Type
|
||||||
hi def link vFloats Type
|
hi def link vFloats Type
|
||||||
hi def link vComplexes Type
|
" XXX Enable when complex numbers implemented in V
|
||||||
|
" hi def link vComplexes Type
|
||||||
|
|
||||||
" Treat fn specially: it's a declaration at the start of a line, but a type
|
" Treat fn specially: it's a declaration at the start of a line, but a type
|
||||||
" elsewhere. Order matters here.
|
" elsewhere. Order matters here.
|
||||||
" syn match vType /\<fn\>/
|
syn match vDeclaration /\<fn\>/
|
||||||
syn match vDeclaration /\<fn\>/
|
syn match vDeclaration contained /\<fn\>/
|
||||||
syn match vDeclaration contained /\<fn\>/
|
|
||||||
|
|
||||||
" Predefined functions and values
|
" Predefined functions and values
|
||||||
syn keyword vBuiltins assert C cap complex copy delete exit imag
|
syn keyword vBuiltins assert C
|
||||||
syn keyword vBuiltins print println eprint eprintln print_backtrace
|
syn keyword vBuiltins complex exit imag
|
||||||
syn keyword vBuiltins float_calloc ok memdup range_int real recover
|
syn keyword vBuiltins print println eprint eprintln
|
||||||
syn keyword vBuiltins malloc byte_calloc float_calloc
|
syn keyword vBuiltins malloc copy memdup isnil
|
||||||
syn keyword vBuiltins isok isnil panic on_panic
|
syn keyword vBuiltins panic recover
|
||||||
syn keyword vConstants iota true false
|
syn match vBuiltins /\<json\.\(encode\|decode\)\>/
|
||||||
syn match vBuiltins /\<json\.\(encode\|decode\)\>/
|
hi def link vBuiltins Keyword
|
||||||
|
|
||||||
hi def link vBuiltins Keyword
|
syn keyword vConstants true false
|
||||||
hi def link vConstants Keyword
|
hi def link vConstants Keyword
|
||||||
|
|
||||||
" Comments; their contents
|
" Comments; their contents
|
||||||
syn keyword vTodo contained TODO FIXME XXX BUG
|
syn keyword vTodo contained TODO FIXME XXX BUG
|
||||||
syn cluster vCommentGroup contains=vTodo
|
hi def link vTodo Todo
|
||||||
syn region vComment start="/\*" end="\*/" contains=@vCommentGroup,@Spell
|
|
||||||
syn region vComment start="//" end="$" contains=@vCommentGroup,@Spell
|
|
||||||
|
|
||||||
hi def link vComment Comment
|
syn cluster vCommentGroup contains=vTodo
|
||||||
hi def link vTodo Todo
|
syn region vComment start="/\*" end="\*/" contains=@vCommentGroup,@Spell
|
||||||
|
syn region vComment start="//" end="$" contains=@vCommentGroup,@Spell
|
||||||
|
hi def link vComment Comment
|
||||||
|
|
||||||
" Go escapes
|
" V escapes
|
||||||
syn match vEscapeOctal display contained "\\[0-7]\{3}"
|
syn match vStringVar display contained +\$[0-9A-Za-z\._]*\([(][^)]*[)]\)\?+
|
||||||
syn match vEscapeVar display contained "\$[0-9A-Za-z\.]*"
|
syn match vStringVar display contained "\${[^}]*}"
|
||||||
syn match vEscapeVar display contained "\${[^}]*}"
|
syn match vStringSpeChar display contained +\\[abfnrtv\\'"]+
|
||||||
syn match vEscapeC display contained +\\[abfnrtv\\'"]+
|
syn match vStringX display contained "\\x\x\{1,2}"
|
||||||
syn match vEscapeX display contained "\\x\x\{2}"
|
syn match vStringU display contained "\\u\x\{4}"
|
||||||
syn match vEscapeU display contained "\\u\x\{4}"
|
syn match vStringBigU display contained "\\U\x\{8}"
|
||||||
syn match vEscapeBigU display contained "\\U\x\{8}"
|
syn match vStringError display contained +\\[^0-7xuUabfnrtv\\'"]+
|
||||||
syn match vEscapeError display contained +\\[^0-7xuUabfnrtv\\'"]+
|
|
||||||
|
|
||||||
hi def link vEscapeOctal vSpecialString
|
hi def link vStringVar Special
|
||||||
hi def link vEscapeVar vSpecialString
|
hi def link vStringSpeChar Special
|
||||||
hi def link vEscapeC vSpecialString
|
hi def link vStringX Special
|
||||||
hi def link vEscapeX vSpecialString
|
hi def link vStringU Special
|
||||||
hi def link vEscapeU vSpecialString
|
hi def link vStringBigU Special
|
||||||
hi def link vEscapeBigU vSpecialString
|
hi def link vStringError Error
|
||||||
hi def link vSpecialString Special
|
|
||||||
hi def link vEscapeError Error
|
" Characters and their contents
|
||||||
|
syn cluster vCharacterGroup contains=vStringSpeChar,vStringVar,vStringX,vStringU,vStringBigU
|
||||||
|
syn region vCharacter start=+`+ end=+`+ contains=@vCharacterGroup
|
||||||
|
hi def link vCharacter Character
|
||||||
|
|
||||||
" Strings and their contents
|
" Strings and their contents
|
||||||
syn cluster vStringGroup contains=vEscapeOctal,vEscapeVar,vEscapeC,vEscapeX,vEscapeU,vEscapeBigU,vEscapeError
|
syn cluster vStringGroup contains=@vCharacterGroup,vStringError
|
||||||
syn region vString start=+"+ skip=+\\\\\|\\'+ end=+"+ contains=@vStringGroup
|
|
||||||
syn region vRawString start=+`+ end=+`+
|
|
||||||
|
|
||||||
hi def link vString String
|
syn region vString start=+"+ skip=+\\\\\|\\'+ end=+"+ contains=@vStringGroup
|
||||||
hi def link vRawString String
|
syn region vString start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@vStringGroup
|
||||||
|
|
||||||
" Characters; their contents
|
syn region vRawString start=+r"+ skip=+\\\\\|\\'+ end=+"+
|
||||||
syn cluster vCharacterGroup contains=vEscapeOctal,vEscapeC,vEscapeVar,vEscapeX,vEscapeU,vEscapeBigU
|
syn region vRawString start=+r'+ skip=+\\\\\|\\'+ end=+'+
|
||||||
syn region vCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@vCharacterGroup
|
|
||||||
|
|
||||||
hi def link vCharacter Character
|
hi def link vString String
|
||||||
|
hi def link vRawString String
|
||||||
|
|
||||||
" Regions
|
" Regions
|
||||||
syn region vBlock start="{" end="}" transparent fold
|
syn region vBlock start="{" end="}" transparent fold
|
||||||
syn region vParen start='(' end=')' transparent
|
syn region vParen start='(' end=')' transparent
|
||||||
|
|
||||||
" Integers
|
" Integers
|
||||||
syn match vDecimalInt "\<\d\+\([Ee]\d\+\)\?\>"
|
syn match vDecimalInt "\<\d\+\([Ee]\d\+\)\?\>"
|
||||||
syn match vHexadecimalInt "\<0x\x\+\>"
|
syn match vOctalInt "\<0o\o\+\>"
|
||||||
syn match vOctalInt "\<0\o\+\>"
|
|
||||||
syn match vOctalError "\<0\o*[89]\d*\>"
|
|
||||||
|
|
||||||
hi def link vDecimalInt Integer
|
hi def link vDecimalInt Integer
|
||||||
hi def link vHexadecimalInt Integer
|
hi def link vOctalInt Integer
|
||||||
hi def link vOctalInt Integer
|
|
||||||
hi def link Integer Number
|
hi def link Integer Number
|
||||||
|
|
||||||
" Floating point
|
" Floating point
|
||||||
syn match vFloat "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>"
|
syn match vFloat "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>"
|
||||||
syn match vFloat "\<\.\d\+\([Ee][-+]\d\+\)\?\>"
|
syn match vFloat "\<\.\d\+\([Ee][-+]\d\+\)\?\>"
|
||||||
syn match vFloat "\<\d\+[Ee][-+]\d\+\>"
|
syn match vFloat "\<\d\+[Ee][-+]\d\+\>"
|
||||||
|
|
||||||
hi def link vFloat Float
|
hi def link vFloat Float
|
||||||
|
hi def link Float Number
|
||||||
|
|
||||||
" Imaginary literals
|
" Imaginary literals
|
||||||
syn match vImaginary "\<\d\+i\>"
|
" XXX Enable when complex numbers are implemented in V
|
||||||
syn match vImaginary "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>"
|
" syn match vImaginary "\<\d\+i\>"
|
||||||
syn match vImaginary "\<\.\d\+\([Ee][-+]\d\+\)\?i\>"
|
" syn match vImaginary "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>"
|
||||||
syn match vImaginary "\<\d\+[Ee][-+]\d\+i\>"
|
" syn match vImaginary "\<\.\d\+\([Ee][-+]\d\+\)\?i\>"
|
||||||
|
" syn match vImaginary "\<\d\+[Ee][-+]\d\+i\>"
|
||||||
hi def link vImaginary Number
|
"
|
||||||
|
" hi def link vImaginary Number
|
||||||
|
|
||||||
" Generics
|
" Generics
|
||||||
syn match vGenericBrackets display contained "[<>]"
|
syn match vGenericBrackets display contained "[<>]"
|
||||||
syn match vInterfaceDeclaration display "\s*\zsinterface\s*\i*\s*<[^>]*>" contains=vDeclType,vGenericBrackets
|
syn match vInterfaceDeclaration display "\s*\zsinterface\s*\i*\s*<[^>]*>" contains=vDeclType,vGenericBrackets
|
||||||
syn match vStructDeclaration display "\s*\zsstruct\s*\i*\s*<[^>]*>" contains=vDeclType,vGenericBrackets
|
syn match vStructDeclaration display "\s*\zsstruct\s*\i*\s*<[^>]*>" contains=vDeclType,vGenericBrackets
|
||||||
" vFunctionName only appears when v_highlight_function_calls set
|
" vFunctionName only appears when v_highlight_function_calls set
|
||||||
syn match vFuncDeclaration display "\s*\zsfn\s*\i*\s*<[^>]*>" contains=vFunctionName,vDeclaration,vGenericBrackets
|
syn match vFuncDeclaration display "\s*\zsfn\s*\i*\s*<[^>]*>" contains=vFunctionName,vDeclaration,vGenericBrackets
|
||||||
|
|
||||||
hi def link vGenericBrackets Identifier
|
hi def link vGenericBrackets Identifier
|
||||||
|
|
||||||
" Spaces after "[]"
|
" Spaces after "[]"
|
||||||
if v_highlight_array_whitespace_error != 0
|
if v_highlight_array_whitespace_error != 0
|
||||||
syn match vSpaceError display "\(\[\]\)\@<=\s\+"
|
syn match vSpaceError display "\(\[\]\)\@<=\s\+"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Spacing errors around the 'chan' keyword
|
" Spacing errors around the 'chan' keyword
|
||||||
if v_highlight_chan_whitespace_error != 0
|
if v_highlight_chan_whitespace_error != 0
|
||||||
" receive-only annotation on chan type
|
" receive-only annotation on chan type
|
||||||
syn match vSpaceError display "\(<-\)\@<=\s\+\(chan\>\)\@="
|
syn match vSpaceError display "\(<-\)\@<=\s\+\(chan\>\)\@="
|
||||||
" send-only annotation on chan type
|
" send-only annotation on chan type
|
||||||
syn match vSpaceError display "\(\<chan\)\@<=\s\+\(<-\)\@="
|
syn match vSpaceError display "\(\<chan\)\@<=\s\+\(<-\)\@="
|
||||||
" value-ignoring receives in a few contexts
|
" value-ignoring receives in a few contexts
|
||||||
syn match vSpaceError display "\(\(^\|[={(,;]\)\s*<-\)\@<=\s\+"
|
syn match vSpaceError display "\(\(^\|[={(,;]\)\s*<-\)\@<=\s\+"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Space-tab error
|
" Space-tab error
|
||||||
if v_highlight_space_tab_error != 0
|
if v_highlight_space_tab_error != 0
|
||||||
syn match vSpaceError display " \+\t"me=e-1
|
syn match vSpaceError display " \+\t"me=e-1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Trailing white space error
|
" Trailing white space error
|
||||||
if v_highlight_trailing_whitespace_error != 0
|
if v_highlight_trailing_whitespace_error != 0
|
||||||
syn match vSpaceError display excludenl "\s\+$"
|
syn match vSpaceError display excludenl "\s\+$"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
hi def link vSpaceError Error
|
hi def link vSpaceError Error
|
||||||
|
|
||||||
" Function calls and Fields are from: https://github.com/fatih/vim-go/blob/master/syntax/go.vim
|
" Function calls and Fields are from: https://github.com/fatih/vim-go/blob/master/syntax/go.vim
|
||||||
" Function calls;
|
" Function calls;
|
||||||
if v_highlight_function_calls
|
if v_highlight_function_calls
|
||||||
syn match vFunctionCall /\w\+\ze\s*(/ contains=vBuiltins,vDeclaration
|
syn match vFunctionCall /\w\+\ze\s*(/ contains=vBuiltins,vDeclaration
|
||||||
syn match vFunctionName display contained /\s\w\+/
|
syn match vFunctionName display contained /\s\w\+/
|
||||||
hi def link vFunctionName Special
|
hi def link vFunctionName Special
|
||||||
endif
|
endif
|
||||||
|
|
||||||
hi def link vFunctionCall Special
|
hi def link vFunctionCall Special
|
||||||
|
|
||||||
" Fields;
|
" Fields;
|
||||||
if v_highlight_fields
|
if v_highlight_fields
|
||||||
@@ -245,14 +247,14 @@ if v_highlight_fields
|
|||||||
" - The symbols: , : .
|
" - The symbols: , : .
|
||||||
" 3. Have the start of highlight (hs) be the start of matched
|
" 3. Have the start of highlight (hs) be the start of matched
|
||||||
" pattern (s) offsetted one to the right (+1) (see :h E401)
|
" pattern (s) offsetted one to the right (+1) (see :h E401)
|
||||||
syn match vField /\.\w\+\
|
syn match vField /\.\w\+\
|
||||||
\%(\%([\/\-\+*%]\)\|\
|
\%(\%([\/\-\+*%]\)\|\
|
||||||
\%([\[\]{}<\>\)]\)\|\
|
\%([\[\]{}<\>\)]\)\|\
|
||||||
\%([\!=\^|&]\)\|\
|
\%([\!=\^|&]\)\|\
|
||||||
\%([\n\r\ ]\)\|\
|
\%([\n\r\ ]\)\|\
|
||||||
\%([,\:.]\)\)\@=/hs=s+1
|
\%([,\:.]\)\)\@=/hs=s+1
|
||||||
endif
|
endif
|
||||||
hi def link vField Identifier
|
hi def link vField Identifier
|
||||||
|
|
||||||
" Search backwards for a global declaration to start processing the syntax.
|
" Search backwards for a global declaration to start processing the syntax.
|
||||||
"syn sync match vSync grouphere NONE /^\(const\|var\|type\|func\)\>/
|
"syn sync match vSync grouphere NONE /^\(const\|var\|type\|func\)\>/
|
||||||
|
|||||||
Reference in New Issue
Block a user