mirror of https://github.com/ray-x/go.nvim
Put syntax file back based on comments of #424
parent
543b4b9346
commit
43850d00fe
@ -0,0 +1,18 @@
|
||||
" this file is copied from vim-go
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
if !exists("g:main_syntax")
|
||||
let g:main_syntax = 'html'
|
||||
endif
|
||||
|
||||
runtime! syntax/gotexttmpl.vim
|
||||
runtime! syntax/html.vim
|
||||
unlet b:current_syntax
|
||||
|
||||
syn cluster htmlPreproc add=gotplAction,goTplComment
|
||||
|
||||
let b:current_syntax = "gohtmltmpl"
|
||||
|
||||
" vim: sw=2 ts=2 et
|
@ -0,0 +1,36 @@
|
||||
" 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
|
||||
" a modified version of gotexttmpl.vim
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
runtime! syntax/go.vim
|
||||
unlet b:current_syntax
|
||||
|
||||
" 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 /\$[a-zA-Z0-9_]*\>/
|
||||
syn match goTplIdentifier contained /\.[^[:blank:]}]\+\>/
|
||||
|
||||
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 goTplComment start="{{\(- \)\?/\*" end="\*/\( -\)\?}}" display
|
||||
|
||||
hi def link gotplAction PreProc
|
||||
hi def link goTplComment Comment
|
||||
|
||||
let b:current_syntax = "gotexttmpl"
|
||||
|
||||
" vim: sw=2 ts=2 et
|
Loading…
Reference in New Issue