VIM syntax summary: disable folding multiline comments

I use the foldmethod "syntax" in vim 7.3. In .vimrc:

set foldmethod=syntax

When I open Test.cpp containing:

/* A function with a multi-line
 * comment. This takes at least
 * four lines and I want to be
 * able to read all of them.
 */
void TheFunction()
{
  DoStuff();
}

When folding, I see the following:

+--  5 lines: A function with a multi-line---------------------------------------------
void TheFunction() 
+--  3 lines: {------------------------------------------------------------------------

I like the folding of the function body, but not the folding of the comment. I want to disable it so that it looks like this:

/* A function with a multi-line
 * comment. This takes at least
 * four lines and I want to be
 * able to read all of them.
 */
void TheFunction() 
+--  3 lines: {------------------------------------------------------------------------

How should I do it? I can see the syntax group related to: syn list cComment

cComment       xxx matchgroup=cCommentStart start=+/\*+ end=+\*/+  extend fold contains
=@cCommentGroup,cCommentStartError,cSpaceError,@Spell
                   links to Comment

But the tool around for an hour with vim and google documentation did not tell me how to remove the "fold" attribute from this group.

? , , , .vimrc.

+5
1

'foldmethod' "syntax", /* */ comments { } blocks . , , :

:let c_no_comment_fold = 1
+5

All Articles