My dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

48 lines
1.7 KiB

  1. " Syntax highlighting variant used for snipmate snippets files
  2. " The snippets.vim file sources this if it wants snipmate mode
  3. if exists("b:current_syntax")
  4. finish
  5. endif
  6. " Embedded syntaxes {{{1
  7. " Re-include the original file so we can share some of its definitions
  8. let b:ultisnips_override_snipmate = 1
  9. syn include <sfile>:h/snippets.vim
  10. unlet b:current_syntax
  11. unlet b:ultisnips_override_snipmate
  12. syn cluster snipTokens contains=snipEscape,snipVisual,snipTabStop,snipMirror,snipmateCommand
  13. syn cluster snipTabStopTokens contains=snipVisual,snipMirror,snipEscape,snipmateCommand
  14. " Syntax definitions {{{1
  15. syn match snipmateComment "^#.*"
  16. syn match snipmateExtends "^extends\%(\s.*\|$\)" contains=snipExtendsKeyword display
  17. syn region snipmateSnippet start="^snippet\ze\%(\s\|$\)" end="^\ze[^[:tab:]]" contains=snipmateSnippetHeader keepend
  18. syn match snipmateSnippetHeader "^.*" contained contains=snipmateKeyword nextgroup=snipmateSnippetBody skipnl skipempty
  19. syn match snipmateKeyword "^snippet\ze\%(\s\|$\)" contained nextgroup=snipmateTrigger skipwhite
  20. syn match snipmateTrigger "\S\+" contained nextgroup=snipmateDescription skipwhite
  21. syn match snipmateDescription "\S.*" contained
  22. syn region snipmateSnippetBody start="^\t" end="^\ze[^[:tab:]]" contained contains=@snipTokens
  23. syn region snipmateCommand keepend matchgroup=snipCommandDelim start="`" skip="\\[{}\\$`]" end="`" contained contains=snipCommandSyntaxOverride,@Viml
  24. " Highlight groups {{{1
  25. hi def link snipmateComment snipComment
  26. hi def link snipmateSnippet snipSnippet
  27. hi def link snipmateKeyword snipKeyword
  28. hi def link snipmateTrigger snipSnippetTrigger
  29. hi def link snipmateDescription snipSnippetDocString
  30. hi def link snipmateCommand snipCommand
  31. " }}}1
  32. let b:current_syntax = "snippets"