From 657a029acc03d1e4e33080f0ebced6f4e17623cb Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Thu, 8 Sep 2016 09:40:39 +0100 Subject: [PATCH] Enable folding {} in C/C++ & delimiter highlights --- after/syntax/c.vim | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/after/syntax/c.vim b/after/syntax/c.vim index 7b6afb8..eac2c81 100644 --- a/after/syntax/c.vim +++ b/after/syntax/c.vim @@ -5,7 +5,7 @@ " Match delimiter expressions: (expr) {expr} : ; " ^ ^ ^ ^ ^ ^ -syn match cDelimiter '[()\[\]{}:;]' +syn match cDelimiter '[()\[\]:;]' " Match single character operators, ordering within the [] is important syn match cOperator '[\*=\.\^\~+\-,&|!%?]' " Match single character operators if they are surrounded by white space: / < > @@ -31,6 +31,12 @@ if g:c_enable_doxygen_highlights hi default link cDoxygen SpecialComment endif +" Match curly braces with cDelimiter highlight group +syn match cCurlyError "}" +syn region cBlock matchgroup=cDelimiter start="{" end="}" contains=ALLBUT,cBadBlock,cCurlyError,@cParenGroup,cErrInParen,cCppParen,cErrInBracket,cCppBracket,@cStringGroup,@Spell fold +syn region cBlock matchgroup=cDelimiter start="{" end="}" transparent fold + + " Define additional highlight groups hi default link cDelimiter Delimiter hi default link cFunction Function