mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated vimrc
This commit is contained in:
@ -52,7 +52,7 @@ if !exists("g:go_highlight_trailing_whitespace_error")
|
||||
endif
|
||||
|
||||
if !exists("g:go_highlight_operators")
|
||||
let g:go_highlight_operators = 1
|
||||
let g:go_highlight_operators = 0
|
||||
endif
|
||||
|
||||
if !exists("g:go_highlight_functions")
|
||||
@ -147,7 +147,7 @@ hi def link goEscapeError Error
|
||||
syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
|
||||
syn region goString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
|
||||
syn region goRawString start=+`+ end=+`+
|
||||
syn match goFormatSpecifier /%[#0\-\ \+\*]*[vTtbcdoqxXUeEfgGsp]/ contained containedin=goString
|
||||
syn match goFormatSpecifier /%[-#0 +]*\%(\*\|\d\+\)\=\%(\.\%(\*\|\d\+\)\)*[vTtbcdoqxXUeEfgGsp]/ contained containedin=goString
|
||||
|
||||
hi def link goString String
|
||||
hi def link goRawString String
|
||||
@ -236,20 +236,18 @@ hi def link goTodo Todo
|
||||
|
||||
" Operators;
|
||||
if g:go_highlight_operators != 0
|
||||
syn match goOperator /:=/
|
||||
syn match goOperator />=/
|
||||
syn match goOperator /<=/
|
||||
syn match goOperator /==/
|
||||
syn match goOperator /!=/
|
||||
syn match goOperator /+=/
|
||||
syn match goOperator /-=/
|
||||
syn match goOperator /\s>\s/
|
||||
syn match goOperator /\s<\s/
|
||||
syn match goOperator /\s+\s/
|
||||
syn match goOperator /\s-\s/
|
||||
syn match goOperator /\s\*\s/
|
||||
syn match goOperator /\s\/\s/
|
||||
syn match goOperator /\s%\s/
|
||||
" match single-char operators: - + % < > ! & | ^ * =
|
||||
" and corresponding two-char operators: -= += %= <= >= != &= |= ^= *= ==
|
||||
syn match goOperator /[-+%<>!&|^*=]=\?/
|
||||
" match / and /=
|
||||
syn match goOperator /\/\%(=\|\ze[^/*]\)/
|
||||
" match two-char operators: << >> &^
|
||||
" and corresponding three-char operators: <<= >>= &^=
|
||||
syn match goOperator /\%(<<\|>>\|&^\)=\?/
|
||||
" match remaining two-char operators: := && || <- ++ --
|
||||
syn match goOperator /:=\|||\|<-\|++\|--/
|
||||
" match ...
|
||||
syn match goOperator /\.\.\./
|
||||
endif
|
||||
hi def link goOperator Operator
|
||||
|
||||
|
15
sources_non_forked/vim-go/syntax/gohtmltmpl.vim
Normal file
15
sources_non_forked/vim-go/syntax/gohtmltmpl.vim
Normal file
@ -0,0 +1,15 @@
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists("main_syntax")
|
||||
let main_syntax = 'html'
|
||||
endif
|
||||
|
||||
runtime! syntax/gotexttmpl.vim
|
||||
runtime! syntax/html.vim
|
||||
unlet b:current_syntax
|
||||
|
||||
let b:current_syntax = "gohtmltmpl"
|
||||
|
||||
" vim:ts=4:sw=4:et
|
85
sources_non_forked/vim-go/syntax/gotexttmpl.vim
Normal file
85
sources_non_forked/vim-go/syntax/gotexttmpl.vim
Normal file
@ -0,0 +1,85 @@
|
||||
" Copyright 2011 The Go Authors. All rights reserved.
|
||||
" Use of this source code is governed by a BSD-style
|
||||
" license that can be found in the LICENSE file.
|
||||
"
|
||||
" gotexttmpl.vim: Vim syntax file for Go templates.
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn case match
|
||||
|
||||
" Go escapes
|
||||
syn match goEscapeOctal display contained "\\[0-7]\{3}"
|
||||
syn match goEscapeC display contained +\\[abfnrtv\\'"]+
|
||||
syn match goEscapeX display contained "\\x\x\{2}"
|
||||
syn match goEscapeU display contained "\\u\x\{4}"
|
||||
syn match goEscapeBigU display contained "\\U\x\{8}"
|
||||
syn match goEscapeError display contained +\\[^0-7xuUabfnrtv\\'"]+
|
||||
|
||||
hi def link goEscapeOctal goSpecialString
|
||||
hi def link goEscapeC goSpecialString
|
||||
hi def link goEscapeX goSpecialString
|
||||
hi def link goEscapeU goSpecialString
|
||||
hi def link goEscapeBigU goSpecialString
|
||||
hi def link goSpecialString Special
|
||||
hi def link goEscapeError Error
|
||||
|
||||
" Strings and their contents
|
||||
syn cluster goStringGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU,goEscapeError
|
||||
syn region goString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@goStringGroup
|
||||
syn region goRawString contained start=+`+ end=+`+
|
||||
|
||||
hi def link goString String
|
||||
hi def link goRawString String
|
||||
|
||||
" Characters; their contents
|
||||
syn cluster goCharacterGroup contains=goEscapeOctal,goEscapeC,goEscapeX,goEscapeU,goEscapeBigU
|
||||
syn region goCharacter start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@goCharacterGroup
|
||||
|
||||
hi def link goCharacter Character
|
||||
|
||||
" Integers
|
||||
syn match goDecimalInt contained "\<\d\+\([Ee]\d\+\)\?\>"
|
||||
syn match goHexadecimalInt contained "\<0x\x\+\>"
|
||||
syn match goOctalInt contained "\<0\o\+\>"
|
||||
syn match goOctalError contained "\<0\o*[89]\d*\>"
|
||||
syn cluster goInt contains=goDecimalInt,goHexadecimalInt,goOctalInt
|
||||
" Floating point
|
||||
syn match goFloat contained "\<\d\+\.\d*\([Ee][-+]\d\+\)\?\>"
|
||||
syn match goFloat contained "\<\.\d\+\([Ee][-+]\d\+\)\?\>"
|
||||
syn match goFloat contained "\<\d\+[Ee][-+]\d\+\>"
|
||||
" Imaginary literals
|
||||
syn match goImaginary contained "\<\d\+i\>"
|
||||
syn match goImaginary contained "\<\d\+\.\d*\([Ee][-+]\d\+\)\?i\>"
|
||||
syn match goImaginary contained "\<\.\d\+\([Ee][-+]\d\+\)\?i\>"
|
||||
syn match goImaginary contained "\<\d\+[Ee][-+]\d\+i\>"
|
||||
|
||||
hi def link goInt Number
|
||||
hi def link goFloat Number
|
||||
hi def link goImaginary Number
|
||||
|
||||
" Token groups
|
||||
syn cluster gotplLiteral contains=goString,goRawString,goCharacter,@goInt,goFloat,goImaginary
|
||||
syn keyword gotplControl contained if else end range with template
|
||||
syn keyword gotplFunctions contained and html index js len not or print printf println urlquery eq ne lt le gt ge
|
||||
syn match gotplVariable contained /\$[^ ]*\>/
|
||||
syn match goTplIdentifier contained /\.[^ ]*\>/
|
||||
|
||||
hi def link gotplControl Keyword
|
||||
hi def link gotplFunctions Function
|
||||
hi def link goTplVariable Special
|
||||
|
||||
syn region gotplAction start="{{" end="}}" contains=@gotplLiteral,gotplControl,gotplFunctions,gotplVariable,goTplIdentifier display
|
||||
syn region gotplAction start="\[\[" end="\]\]" contains=@gotplLiteral,gotplControl,gotplFunctions,gotplVariable display
|
||||
syn region goTplComment start="{{/\*" end="\*/}}" display
|
||||
syn region goTplComment start="\[\[/\*" end="\*/\]\]" display
|
||||
|
||||
hi def link gotplAction PreProc
|
||||
hi def link goTplComment Comment
|
||||
|
||||
let b:current_syntax = "gotexttmpl"
|
||||
|
||||
" vim:ts=4:sw=4:et
|
Reference in New Issue
Block a user