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.
 
 

91 lines
3.5 KiB

  1. "=============================================================================
  2. " FILE: syntaxtax/snippet.vim
  3. " AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
  4. " License: MIT license
  5. "=============================================================================
  6. if version < 700
  7. syntax clear
  8. elseif exists("b:current_syntax")
  9. finish
  10. endif
  11. syntax region neosnippetString
  12. \ start=+'+ end=+'+ contained
  13. syntax region neosnippetString
  14. \ start=+"+ end=+"+ contained
  15. syntax region neosnippetEval
  16. \ start=+\\\@<!`+ end=+\\\@<!`+ contained
  17. syntax match neosnippetWord
  18. \ '^\s\+.*$' contains=
  19. \neosnippetEval,neosnippetPlaceHolder,neosnippetEscape,neosnippetVariable
  20. syntax match neosnippetPlaceHolder
  21. \ '\%(\\\@<!\|\\\\\zs\)\${\d\+\%(:.\{-}\)\?\\\@<!}'
  22. \ contained contains=neosnippetPlaceHolderComment
  23. syntax match neosnippetVariable
  24. \ '\\\@<!\$\d\+' contained
  25. syntax match neosnippetComment
  26. \ '^#.*$'
  27. syntax match neosnippetEscape
  28. \ '\\[`]' contained
  29. syntax match neosnippetKeyword
  30. \ '^\%(include\|source\|snippet\|abbr\|prev_word\|delete\|alias\|options\|regexp\|TARGET\)' contained
  31. syntax keyword neosnippetOption
  32. \ head word indent contained
  33. syntax match neosnippetPrevWords
  34. \ '^prev_word\s\+.*$' contains=neosnippetString,neosnippetKeyword
  35. syntax match neosnippetRegexpr
  36. \ '^regexp\s\+.*$' contains=neosnippetString,neosnippetKeyword
  37. syntax match neosnippetStatementName
  38. \ '^snippet\s.*$' contains=neosnippetName,neosnippetKeyword
  39. syntax match neosnippetName
  40. \ '\s\+.*$' contained
  41. syntax match neosnippetStatementAbbr
  42. \ '^abbr\s.*$' contains=neosnippetAbbr,neosnippetKeyword
  43. syntax match neosnippetAbbr
  44. \ '\s\+.*$' contained
  45. syntax match neosnippetStatementRank
  46. \ '^rank\s.*$' contains=neosnippetRank,neosnippetKeyword
  47. syntax match neosnippetRank
  48. \ '\s\+\d\+$' contained
  49. syntax match neosnippetStatementInclude
  50. \ '^include\s.*$' contains=neosnippetInclude,neosnippetKeyword
  51. syntax match neosnippetInclude
  52. \ '\s\+.*$' contained
  53. syntax match neosnippetStatementSource
  54. \ '^source\s.*$' contains=neosnippetSource,neosnippetKeyword
  55. syntax match neosnippetSource
  56. \ '\s\+.*$' contained
  57. syntax match neosnippetStatementDelete
  58. \ '^delete\s.*$' contains=neosnippetDelete,neosnippetKeyword
  59. syntax match neosnippetDelete
  60. \ '\s\+.*$' contained
  61. syntax match neosnippetStatementAlias
  62. \ '^alias\s.*$' contains=neosnippetAlias,neosnippetKeyword
  63. syntax match neosnippetAlias
  64. \ '\s\+.*$' contained
  65. syntax match neosnippetStatementOptions
  66. \ '^options\s.*$' contains=neosnippetOption,neosnippetKeyword
  67. syntax match neosnippetPlaceHolderComment
  68. \ '{\d\+:\zs#:.\{-}\ze\\\@<!}' contained
  69. highlight def link neosnippetKeyword Statement
  70. highlight def link neosnippetString String
  71. highlight def link neosnippetName Identifier
  72. highlight def link neosnippetAbbr Normal
  73. highlight def link neosnippetEval Type
  74. highlight def link neosnippetWord String
  75. highlight def link neosnippetPlaceHolder Special
  76. highlight def link neosnippetPlaceHolderComment Comment
  77. highlight def link neosnippetVariable Special
  78. highlight def link neosnippetComment Comment
  79. highlight def link neosnippetInclude PreProc
  80. highlight def link neosnippetSource PreProc
  81. highlight def link neosnippetDelete PreProc
  82. highlight def link neosnippetOption PreProc
  83. highlight def link neosnippetAlias Identifier
  84. highlight def link neosnippetEscape Special
  85. let b:current_syntax = 'snippet'