From 69194ed8537cf1f1d9fb9281df26b23d7360074b Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Tue, 18 Feb 2014 18:57:43 +0100 Subject: [PATCH] Added syntax highlighting for leading spaces, as they are most likely wrong. --- syntax/snippets.vim | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/syntax/snippets.vim b/syntax/snippets.vim index 1e9fda0..cacafb3 100644 --- a/syntax/snippets.vim +++ b/syntax/snippets.vim @@ -15,6 +15,7 @@ syn keyword snipTODO FIXME NOTE NOTES TODO XXX contained syn match snipDocString '"[^"]*"$' syn match snipString '"[^"]*"' syn match snipTabsOnly "^\t\+$" +syn match snipLeadingSpaces "^\t* \+" syn match snipKeyword "\(\<\(end\)\?\(snippet\|global\)\>\)\|extends\|clearsnippets" contained @@ -30,39 +31,40 @@ syn region snipVimLCommand contained keepend start="`!v" end="`" contained conta 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,snipVisual +syn region snippet fold keepend start="^snippet" end="^endsnippet" contains=snipStart,snipEnd,snipTabsOnly,snipLeadingSpaces,snipCommand,snipVarExpansion,snipVar,snipVisual " global definitions syn match snipGlobalStart "^global.*" contained contains=snipKeyword,snipString syn match snipGlobalEnd "^endglobal" contained contains=snipKeyword -syn region snipGlobal fold keepend start="^global" end="^endglobal" contains=snipGlobalStart,snipGlobalEnd,snipTabsOnly,snipCommand,snipVarExpansion,snipVar,@Python +syn region snipGlobal fold keepend start="^global" end="^endglobal" contains=snipGlobalStart,snipGlobalEnd,snipLeadingSpaces,snipTabsOnly,snipCommand,snipVarExpansion,snipVar,@Python " snippet clearing syn match snipClear "^clearsnippets" " highlighting rules -hi link snipComment Comment -hi link snipString String -hi link snipDocString String -hi link snipTabsOnly Error +hi link snipComment Comment +hi link snipLeadingSpaces Error +hi link snipString String +hi link snipDocString String +hi link snipTabsOnly Error -hi link snipKeyword Keyword +hi link snipKeyword Keyword -hi link snipExtends Statement +hi link snipExtends Statement -hi link snipStart Statement -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 snipStart Statement +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 -hi link snipGlobalEnd Statement -hi link snipGlobal Normal +hi link snipGlobalStart Statement +hi link snipGlobalEnd Statement +hi link snipGlobal Normal -hi link snipClear Statement +hi link snipClear Statement let b:current_syntax = "snippet"