-
-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put syntax file back based on comments of #424
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |