- Added get_selected_text().

This commit is contained in:
Shougo Matsushita
2012-10-29 19:27:18 +09:00
parent d4870c9987
commit c1cfe686ad
5 changed files with 102 additions and 53 deletions

View File

@@ -33,47 +33,50 @@ elseif exists("b:current_syntax")
finish
endif
syn region SnippetPrevWord start=+'+ end=+'+ contained
syn region SnippetPrevWord start=+"+ end=+"+ contained
syn region SnippetEval start=+\\\@<!`+ end=+\\\@<!`+ contained
syn match SnippetWord '^\s\+.*$' contains=
\SnippetEval,SnippetExpand,SnippetEscape,SnippetVariable
syn match SnippetExpand '\${\d\+\%(:.\{-}\)\?\\\@<!}' contained
syn match SnippetVariable '\$\d\+' contained
syn match SnippetComment '^#.*$'
syn match SnippetEscape '\\[`]' contained
syn region neosnippetPrevWord start=+'+ end=+'+ contained
syn region neosnippetPrevWord start=+"+ end=+"+ contained
syn region neosnippetEval start=+\\\@<!`+ end=+\\\@<!`+ contained
syn match neosnippetWord '^\s\+.*$' contains=
\neosnippetEval,neosnippetPlaceHolder,neosnippetEscape,neosnippetVariable
syn match neosnippetPlaceHolder '\${\d\+\%(:.\{-}\)\?\\\@<!}'
\ contained contains=neosnippetPlaceHolderComment
syn match neosnippetVariable '\$\d\+' contained
syn match neosnippetComment '^#.*$'
syn match neosnippetEscape '\\[`]' contained
syn match SnippetKeyword '^\%(include\|snippet\|abbr\|prev_word\|delete\|alias\|options\)' contained
syn keyword SnippetOption head word contained
syn match SnippetPrevWords '^prev_word\s\+.*$' contains=SnippetPrevWord,SnippetKeyword
syn match SnippetStatementName '^snippet\s.*$' contains=SnippetName,SnippetKeyword
syn match SnippetName '\s\+.*$' contained
syn match SnippetStatementAbbr '^abbr\s.*$' contains=SnippetAbbr,SnippetKeyword
syn match SnippetAbbr '\s\+.*$' contained
syn match SnippetStatementRank '^rank\s.*$' contains=SnippetRank,SnippetKeyword
syn match SnippetRank '\s\+\d\+$' contained
syn match SnippetStatementInclude '^include\s.*$' contains=SnippetInclude,SnippetKeyword
syn match SnippetInclude '\s\+.*$' contained
syn match SnippetStatementDelete '^delete\s.*$' contains=SnippetDelete,SnippetKeyword
syn match SnippetDelete '\s\+.*$' contained
syn match SnippetStatementAlias '^alias\s.*$' contains=SnippetAlias,SnippetKeyword
syn match SnippetAlias '\s\+.*$' contained
syn match SnippetStatementOptions '^options\s.*$' contains=SnippetOption,SnippetKeyword
syn match neosnippetKeyword '^\%(include\|snippet\|abbr\|prev_word\|delete\|alias\|options\)' contained
syn keyword neosnippetOption head word contained
syn match neosnippetPrevWords '^prev_word\s\+.*$' contains=neosnippetPrevWord,neosnippetKeyword
syn match neosnippetStatementName '^snippet\s.*$' contains=neosnippetName,neosnippetKeyword
syn match neosnippetName '\s\+.*$' contained
syn match neosnippetStatementAbbr '^abbr\s.*$' contains=neosnippetAbbr,neosnippetKeyword
syn match neosnippetAbbr '\s\+.*$' contained
syn match neosnippetStatementRank '^rank\s.*$' contains=neosnippetRank,neosnippetKeyword
syn match neosnippetRank '\s\+\d\+$' contained
syn match neosnippetStatementInclude '^include\s.*$' contains=neosnippetInclude,neosnippetKeyword
syn match neosnippetInclude '\s\+.*$' contained
syn match neosnippetStatementDelete '^delete\s.*$' contains=neosnippetDelete,neosnippetKeyword
syn match neosnippetDelete '\s\+.*$' contained
syn match neosnippetStatementAlias '^alias\s.*$' contains=neosnippetAlias,neosnippetKeyword
syn match neosnippetAlias '\s\+.*$' contained
syn match neosnippetStatementOptions '^options\s.*$' contains=neosnippetOption,neosnippetKeyword
syn match neosnippetPlaceHolderComment '{\d\+:\zs#:.\{-}\ze\\\@<!}' contained
hi def link SnippetKeyword Statement
hi def link SnippetPrevWord String
hi def link SnippetName Identifier
hi def link SnippetAbbr Normal
hi def link SnippetEval Type
hi def link SnippetWord String
hi def link SnippetExpand Special
hi def link SnippetVariable Special
hi def link SnippetComment Comment
hi def link SnippetInclude PreProc
hi def link SnippetDelete PreProc
hi def link SnippetOption PreProc
hi def link SnippetAlias Identifier
hi def link SnippetEscape Special
hi def link neosnippetKeyword Statement
hi def link neosnippetPrevWord String
hi def link neosnippetName Identifier
hi def link neosnippetAbbr Normal
hi def link neosnippetEval Type
hi def link neosnippetWord String
hi def link neosnippetPlaceHolder Special
hi def link neosnippetPlaceHolderComment Comment
hi def link neosnippetVariable Special
hi def link neosnippetComment Comment
hi def link neosnippetInclude PreProc
hi def link neosnippetDelete PreProc
hi def link neosnippetOption PreProc
hi def link neosnippetAlias Identifier
hi def link neosnippetEscape Special
let b:current_syntax = "snippet"