Rewrite syntax matching for snippet

This commit is contained in:
Kevin Ballard 2014-06-29 23:33:36 -07:00
parent 5937cea081
commit cb2905c178

View File

@ -39,10 +39,12 @@ syn match snipExtendsKeyword "^extends" contained display
" snippet {{{3 " snippet {{{3
syn region snipSnippet fold keepend start="^snippet" end="^endsnippet" contains=snipStart,snipEnd,snipTabsOnly,snipLeadingSpaces,snipCommand,snipVarExpansion,snipVar,snipVisual syn region snipSnippet start="^snippet\_s" end="^endsnippet\s*$" contains=snipSnippetHeader fold keepend
syn match snipSnippetHeader "^.*$" nextgroup=snipSnippetBody skipnl contained contains=snipSnippetHeaderKeyword
syn match snipStart "^snippet.*" contained contains=snipKeyword,snipDocString syn match snipSnippetHeaderKeyword "^snippet" contained nextgroup=snipSnippetTrigger
syn match snipEnd "^endsnippet" contained contains=snipKeyword syn region snipSnippetBody start="\_." end="^\zeendsnippet\s*$" contained contains=snipTabsOnly,snipLeadingSpaces,snipCommand,snipVarExpansion,snipVar,snipVisual nextgroup=snipSnippetFooter
syn match snipSnippetFooter "^endsnippet.*" contained contains=snipSnippetFooterKeyword
syn match snipSnippetFooterKeyword "^endsnippet" contained
" Command substitution {{{4 " Command substitution {{{4
@ -86,6 +88,9 @@ hi def link snipKeyword Keyword
hi def link snipExtendsKeyword Keyword hi def link snipExtendsKeyword Keyword
hi def link snipSnippetHeaderKeyword snipKeyword
hi def link snipSnippetFooterKeyword snipKeyword
hi def link snipStart Statement hi def link snipStart Statement
hi def link snipEnd snipStart hi def link snipEnd snipStart