2011-02-17 08:07:27 -05:00
|
|
|
" Syntax highlighting for snippet files (used for UltiSnips.vim)
|
2011-03-27 02:07:44 -04:00
|
|
|
" Revision: 26/03/11 19:53:33
|
|
|
|
|
|
|
|
if exists("b:current_syntax")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
|
|
|
syntax include @Python syntax/python.vim
|
2011-02-17 08:07:27 -05:00
|
|
|
|
|
|
|
" global matches
|
2011-03-27 02:07:44 -04:00
|
|
|
syn match snipComment "^#.*" contains=snipTODO
|
|
|
|
syn keyword snipTODO FIXME NOTE NOTES TODO XXX contained
|
|
|
|
|
2011-02-17 08:07:27 -05:00
|
|
|
syn match snipString '"[^"]*"'
|
|
|
|
syn match snipTabsOnly "^\t\+$"
|
|
|
|
|
2011-02-19 14:00:24 -05:00
|
|
|
syn match snipKeyword "\(\<\(end\)\?\(snippet\|global\)\>\)\|extends" contained
|
|
|
|
|
|
|
|
" extends definitions
|
|
|
|
syn match snipExtends "^extends.*" contains=snipKeyword
|
2011-02-17 08:07:27 -05:00
|
|
|
|
|
|
|
" snippet definitions
|
|
|
|
syn match snipStart "^snippet.*" contained contains=snipKeyword,snipString
|
|
|
|
syn match snipEnd "^endsnippet" contained contains=snipKeyword
|
2011-03-27 02:07:44 -04:00
|
|
|
syn region snipCommand contained keepend start="`" end="`" contains=snipPythonCommand
|
|
|
|
syn region snipPythonCommand contained keepend start="`!p" end="`" contained contains=@Python
|
2011-02-19 14:00:24 -05:00
|
|
|
syn match snipVar "\$\d" contained
|
|
|
|
syn region snipVarExpansion matchgroup=Define start="\${\d" end="}" contained contains=snipVar,snipVarExpansion,snipCommand
|
|
|
|
syn region snippet fold keepend start="^snippet" end="^endsnippet" contains=snipStart,snipEnd,snipTabsOnly,snipCommand,snipVarExpansion,snipVar
|
2011-02-17 08:07:27 -05:00
|
|
|
|
|
|
|
" global definitions
|
|
|
|
syn match snipGlobalStart "^global.*" contained contains=snipKeyword,snipString
|
|
|
|
syn match snipGlobalEnd "^endglobal" contained contains=snipKeyword
|
2011-03-27 02:07:44 -04:00
|
|
|
syn region snipGlobal fold keepend start="^global" end="^endglobal" contains=snipGlobalStart,snipGlobalEnd,snipTabsOnly,snipCommand,snipVarExpansion,snipVar,@Python
|
2011-02-17 08:07:27 -05:00
|
|
|
|
|
|
|
" highlighting rules
|
|
|
|
|
2011-02-19 14:00:24 -05:00
|
|
|
hi link snipComment Comment
|
|
|
|
hi link snipString String
|
|
|
|
hi link snipTabsOnly Error
|
|
|
|
|
|
|
|
hi link snipKeyword Keyword
|
2011-02-17 08:07:27 -05:00
|
|
|
|
2011-02-19 14:00:24 -05:00
|
|
|
hi link snipExtends Statement
|
2011-02-17 08:07:27 -05:00
|
|
|
|
2011-02-19 14:00:24 -05:00
|
|
|
hi link snipStart Statement
|
|
|
|
hi link snipEnd Statement
|
|
|
|
hi link snipCommand Special
|
2011-03-27 02:07:44 -04:00
|
|
|
hi link snipVar StorageClass
|
2011-02-19 14:00:24 -05:00
|
|
|
hi link snipVarExpansion Normal
|
|
|
|
hi link snippet Normal
|
2011-02-17 08:07:27 -05:00
|
|
|
|
2011-02-19 14:00:24 -05:00
|
|
|
hi link snipGlobalStart Statement
|
|
|
|
hi link snipGlobalEnd Statement
|
|
|
|
hi link snipGlobal Normal
|
2011-03-27 02:07:44 -04:00
|
|
|
|
|
|
|
let b:current_syntax = "snippet"
|