2012-02-02 04:33:35 +00:00
|
|
|
"=============================================================================
|
2013-04-11 01:46:19 +00:00
|
|
|
" FILE: syntaxtax/snippet.vim
|
2012-02-02 04:33:35 +00:00
|
|
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
|
|
|
" Last Modified: 15 Sep 2010
|
|
|
|
" License: MIT license {{{
|
|
|
|
" Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
" a copy of this software and associated documentation files (the
|
|
|
|
" "Software"), to deal in the Software without restriction, including
|
|
|
|
" without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
" distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
" permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
" the following conditions:
|
|
|
|
"
|
|
|
|
" The above copyright notice and this permission notice shall be included
|
|
|
|
" in all copies or substantial portions of the Software.
|
|
|
|
"
|
|
|
|
" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
|
|
" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
|
|
" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
|
|
" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
|
|
" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
" }}}
|
|
|
|
"=============================================================================
|
|
|
|
|
|
|
|
let s:save_cpo = &cpo
|
|
|
|
set cpo&vim
|
|
|
|
|
|
|
|
if version < 700
|
|
|
|
syntax clear
|
2013-04-11 01:46:19 +00:00
|
|
|
elseif exists("b:current_syntaxtax")
|
2012-02-02 04:33:35 +00:00
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
2013-04-11 01:46:19 +00:00
|
|
|
syntax region neosnippetString
|
|
|
|
\ start=+'+ end=+'+ contained
|
|
|
|
syntax region neosnippetString
|
|
|
|
\ start=+"+ end=+"+ contained
|
|
|
|
syntax region neosnippetEval
|
|
|
|
\ start=+\\\@<!`+ end=+\\\@<!`+ contained
|
|
|
|
syntax match neosnippetWord
|
|
|
|
\'^\s\+.*$' contains=
|
2012-10-29 10:27:18 +00:00
|
|
|
\neosnippetEval,neosnippetPlaceHolder,neosnippetEscape,neosnippetVariable
|
2013-04-11 01:46:19 +00:00
|
|
|
syntax match neosnippetPlaceHolder
|
|
|
|
\'\\\@<!\${\d\+\%(:.\{-}\)\?\\\@<!}'
|
2012-10-29 10:27:18 +00:00
|
|
|
\ contained contains=neosnippetPlaceHolderComment
|
2013-04-11 01:46:19 +00:00
|
|
|
syntax match neosnippetVariable
|
|
|
|
\'\\\@<!\$\d\+' contained
|
|
|
|
syntax match neosnippetComment
|
|
|
|
\'^#.*$'
|
|
|
|
syntax match neosnippetEscape
|
|
|
|
\'\\[`]' contained
|
2012-02-02 04:33:35 +00:00
|
|
|
|
2013-04-11 01:46:19 +00:00
|
|
|
syntax match neosnippetKeyword
|
|
|
|
\'^\%(include\|snippet\|abbr\|prev_word\|delete\|alias\|options\|regexp\|TARGET\)' contained
|
|
|
|
syntax keyword neosnippetOption
|
|
|
|
\ head word indent contained
|
|
|
|
syntax match neosnippetPrevWords
|
|
|
|
\'^prev_word\s\+.*$' contains=neosnippetString,neosnippetKeyword
|
|
|
|
syntax match neosnippetRegexpr
|
|
|
|
\'^regexp\s\+.*$' contains=neosnippetString,neosnippetKeyword
|
|
|
|
syntax match neosnippetStatementName
|
|
|
|
\'^snippet\s.*$' contains=neosnippetName,neosnippetKeyword
|
|
|
|
syntax match neosnippetName
|
|
|
|
\'\s\+.*$' contained
|
|
|
|
syntax match neosnippetStatementAbbr
|
|
|
|
\'^abbr\s.*$' contains=neosnippetAbbr,neosnippetKeyword
|
|
|
|
syntax match neosnippetAbbr
|
|
|
|
\'\s\+.*$' contained
|
|
|
|
syntax match neosnippetStatementRank
|
|
|
|
\'^rank\s.*$' contains=neosnippetRank,neosnippetKeyword
|
|
|
|
syntax match neosnippetRank
|
|
|
|
\'\s\+\d\+$' contained
|
|
|
|
syntax match neosnippetStatementInclude
|
|
|
|
\'^include\s.*$' contains=neosnippetInclude,neosnippetKeyword
|
|
|
|
syntax match neosnippetInclude
|
|
|
|
\'\s\+.*$' contained
|
|
|
|
syntax match neosnippetStatementDelete
|
|
|
|
\'^delete\s.*$' contains=neosnippetDelete,neosnippetKeyword
|
|
|
|
syntax match neosnippetDelete
|
|
|
|
\'\s\+.*$' contained
|
|
|
|
syntax match neosnippetStatementAlias
|
|
|
|
\'^alias\s.*$' contains=neosnippetAlias,neosnippetKeyword
|
|
|
|
syntax match neosnippetAlias
|
|
|
|
\'\s\+.*$' contained
|
|
|
|
syntax match neosnippetStatementOptions
|
|
|
|
\'^options\s.*$' contains=neosnippetOption,neosnippetKeyword
|
|
|
|
syntax match neosnippetPlaceHolderComment
|
|
|
|
\'{\d\+:\zs#:.\{-}\ze\\\@<!}' contained
|
2012-02-02 04:33:35 +00:00
|
|
|
|
2013-04-11 01:46:19 +00:00
|
|
|
highlight def link neosnippetKeyword Statement
|
|
|
|
highlight def link neosnippetString String
|
|
|
|
highlight def link neosnippetName Identifier
|
|
|
|
highlight def link neosnippetAbbr Normal
|
|
|
|
highlight def link neosnippetEval Type
|
|
|
|
highlight def link neosnippetWord String
|
|
|
|
highlight def link neosnippetPlaceHolder Special
|
|
|
|
highlight def link neosnippetPlaceHolderComment Comment
|
|
|
|
highlight def link neosnippetVariable Special
|
|
|
|
highlight def link neosnippetComment Comment
|
|
|
|
highlight def link neosnippetInclude PreProc
|
|
|
|
highlight def link neosnippetDelete PreProc
|
|
|
|
highlight def link neosnippetOption PreProc
|
|
|
|
highlight def link neosnippetAlias Identifier
|
|
|
|
highlight def link neosnippetEscape Special
|
2012-02-02 04:33:35 +00:00
|
|
|
|
2013-04-11 01:46:19 +00:00
|
|
|
let b:current_syntaxtax = "snippet"
|
2012-02-02 04:33:35 +00:00
|
|
|
|
|
|
|
let &cpo = s:save_cpo
|
|
|
|
unlet s:save_cpo
|