Skip to content

Commit

Permalink
Some improvements to Syntax highlighting including support for ${VISUAL}
Browse files Browse the repository at this point in the history
  • Loading branch information
SirVer committed Feb 5, 2012
1 parent 49d9ff2 commit b0827fe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions syntax/snippets.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ if exists("b:current_syntax")
endif

syntax include @Python syntax/python.vim
syntax include @Viml syntax/vim.vim

" global matches
syn match snipComment "^#.*" contains=snipTODO
Expand All @@ -22,11 +23,13 @@ syn match snipExtends "^extends.*" contains=snipKeyword
" snippet definitions
syn match snipStart "^snippet.*" contained contains=snipKeyword,snipString
syn match snipEnd "^endsnippet" contained contains=snipKeyword
syn region snipCommand contained keepend start="`" end="`" contains=snipPythonCommand
syn region snipCommand contained keepend start="`" end="`" contains=snipPythonCommand,snipVimLCommand
syn region snipPythonCommand contained keepend start="`!p" end="`" contained contains=@Python
syn region snipVimLCommand contained keepend start="`!v" end="`" contained contains=@Viml
syn match snipVar "\$\d" contained
syn region snipVisual matchgroup=Define start="\${VISUAL" end="}" 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
syn region snippet fold keepend start="^snippet" end="^endsnippet" contains=snipStart,snipEnd,snipTabsOnly,snipCommand,snipVarExpansion,snipVar,snipVisual

" global definitions
syn match snipGlobalStart "^global.*" contained contains=snipKeyword,snipString
Expand All @@ -48,6 +51,7 @@ hi link snipEnd Statement
hi link snipCommand Special
hi link snipVar StorageClass
hi link snipVarExpansion Normal
hi link snipVisual Normal
hi link snippet Normal

hi link snipGlobalStart Statement
Expand Down

0 comments on commit b0827fe

Please sign in to comment.