1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 09:35:01 +08:00

Updated plugins

This commit is contained in:
amix
2017-09-02 12:43:18 +02:00
parent 3be3af28e5
commit 7fc202ec88
64 changed files with 1659 additions and 525 deletions

View File

@ -89,12 +89,32 @@ if !exists("g:go_highlight_generate_tags")
let g:go_highlight_generate_tags = 0
endif
let s:fold_block = 1
let s:fold_import = 1
let s:fold_varconst = 1
if exists("g:go_fold_enable")
if index(g:go_fold_enable, 'block') == -1
let s:fold_block = 0
endif
if index(g:go_fold_enable, 'import') == -1
let s:fold_import = 0
endif
if index(g:go_fold_enable, 'varconst') == -1
let s:fold_varconst = 0
endif
endif
syn case match
syn keyword goDirective package import
syn keyword goDeclaration var const
syn keyword goPackage package
syn keyword goImport import contained
syn keyword goVar var contained
syn keyword goConst const contained
hi def link goDirective Statement
hi def link goPackage Statement
hi def link goImport Statement
hi def link goVar Keyword
hi def link goConst Keyword
hi def link goDeclaration Keyword
" Keywords within functions
@ -189,8 +209,35 @@ syn region goCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=
hi def link goCharacter Character
" Regions
syn region goBlock start="{" end="}" transparent fold
syn region goParen start='(' end=')' transparent
if s:fold_block
syn region goBlock start="{" end="}" transparent fold
else
syn region goBlock start="{" end="}" transparent
endif
" import
if s:fold_import
syn region goImport start='import (' end=')' transparent fold contains=goImport,goString,goComment
else
syn region goImport start='import (' end=')' transparent contains=goImport,goString,goComment
endif
" var, const
if s:fold_varconst
syn region goVar start='var (' end='^\s*)$' transparent fold
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar
syn region goConst start='const (' end='^\s*)$' transparent fold
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar
else
syn region goVar start='var (' end='^\s*)$' transparent
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar
syn region goConst start='const (' end='^\s*)$' transparent
\ contains=ALLBUT,goParen,goBlock,goFunction,goTypeName,goReceiverType,goReceiverVar
endif
" Single-line var, const, and import.
syn match goSingleDecl /\(import\|var\|const\) [^(]\@=/ contains=goImport,goVar,goConst
" Integers
syn match goDecimalInt "\<-\=\d\+\%([Ee][-+]\=\d\+\)\=\>"
@ -321,7 +368,7 @@ hi def link goField Identifier
" Structs & Interfaces;
if g:go_highlight_types != 0
syn match goTypeConstructor /\<\w\+{\@=/he=e-1
syn match goTypeConstructor /\<\w\+{\@=/
syn match goTypeDecl /\<type\>/ nextgroup=goTypeName skipwhite skipnl
syn match goTypeName /\w\+/ contained nextgroup=goDeclType skipwhite skipnl
syn match goDeclType /\<\(interface\|struct\)\>/ skipwhite skipnl