neosnippet.vim/syntax/snippet.vim

112 lines
4.5 KiB
VimL
Raw Normal View History

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>
2013-04-12 08:13:38 +00:00
" Last Modified: 12 Apr 2013
2012-02-02 04:33:35 +00:00
" 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-12 08:13:38 +00:00
elseif exists("b:current_syntax")
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
2013-04-12 07:22:36 +00:00
\ '^\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
2013-04-12 07:22:36 +00:00
\ '\\\@<!\${\d\+\%(:.\{-}\)\?\\\@<!}'
2012-10-29 10:27:18 +00:00
\ contained contains=neosnippetPlaceHolderComment
2013-04-11 01:46:19 +00:00
syntax match neosnippetVariable
2013-04-12 07:22:36 +00:00
\ '\\\@<!\$\d\+' contained
2013-04-11 01:46:19 +00:00
syntax match neosnippetComment
2013-04-12 07:22:36 +00:00
\ '^#.*$'
2013-04-11 01:46:19 +00:00
syntax match neosnippetEscape
2013-04-12 07:22:36 +00:00
\ '\\[`]' contained
2012-02-02 04:33:35 +00:00
2013-04-11 01:46:19 +00:00
syntax match neosnippetKeyword
2013-04-12 07:22:36 +00:00
\ '^\%(include\|snippet\|abbr\|prev_word\|delete\|alias\|options\|regexp\|TARGET\)' contained
2013-04-11 01:46:19 +00:00
syntax keyword neosnippetOption
\ head word indent contained
syntax match neosnippetPrevWords
2013-04-12 07:22:36 +00:00
\ '^prev_word\s\+.*$' contains=neosnippetString,neosnippetKeyword
2013-04-11 01:46:19 +00:00
syntax match neosnippetRegexpr
2013-04-12 07:22:36 +00:00
\ '^regexp\s\+.*$' contains=neosnippetString,neosnippetKeyword
2013-04-11 01:46:19 +00:00
syntax match neosnippetStatementName
2013-04-12 07:22:36 +00:00
\ '^snippet\s.*$' contains=neosnippetName,neosnippetKeyword
2013-04-11 01:46:19 +00:00
syntax match neosnippetName
2013-04-12 07:22:36 +00:00
\ '\s\+.*$' contained
2013-04-11 01:46:19 +00:00
syntax match neosnippetStatementAbbr
2013-04-12 07:22:36 +00:00
\ '^abbr\s.*$' contains=neosnippetAbbr,neosnippetKeyword
2013-04-11 01:46:19 +00:00
syntax match neosnippetAbbr
2013-04-12 07:22:36 +00:00
\ '\s\+.*$' contained
2013-04-11 01:46:19 +00:00
syntax match neosnippetStatementRank
2013-04-12 07:22:36 +00:00
\ '^rank\s.*$' contains=neosnippetRank,neosnippetKeyword
2013-04-11 01:46:19 +00:00
syntax match neosnippetRank
2013-04-12 07:22:36 +00:00
\ '\s\+\d\+$' contained
2013-04-11 01:46:19 +00:00
syntax match neosnippetStatementInclude
2013-04-12 07:22:36 +00:00
\ '^include\s.*$' contains=neosnippetInclude,neosnippetKeyword
2013-04-11 01:46:19 +00:00
syntax match neosnippetInclude
2013-04-12 07:22:36 +00:00
\ '\s\+.*$' contained
2013-04-11 01:46:19 +00:00
syntax match neosnippetStatementDelete
2013-04-12 07:22:36 +00:00
\ '^delete\s.*$' contains=neosnippetDelete,neosnippetKeyword
2013-04-11 01:46:19 +00:00
syntax match neosnippetDelete
2013-04-12 07:22:36 +00:00
\ '\s\+.*$' contained
2013-04-11 01:46:19 +00:00
syntax match neosnippetStatementAlias
2013-04-12 07:22:36 +00:00
\ '^alias\s.*$' contains=neosnippetAlias,neosnippetKeyword
2013-04-11 01:46:19 +00:00
syntax match neosnippetAlias
2013-04-12 07:22:36 +00:00
\ '\s\+.*$' contained
2013-04-11 01:46:19 +00:00
syntax match neosnippetStatementOptions
2013-04-12 07:22:36 +00:00
\ '^options\s.*$' contains=neosnippetOption,neosnippetKeyword
2013-04-11 01:46:19 +00:00
syntax match neosnippetPlaceHolderComment
2013-04-12 07:22:36 +00:00
\ '{\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-12 08:13:38 +00:00
let b:current_syntax = "snippet"
2012-02-02 04:33:35 +00:00
let &cpo = s:save_cpo
unlet s:save_cpo