Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7759735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:42:21+00:00 2026-06-01T13:42:21+00:00

I use the syntax foldmethod in vim 7.3. In .vimrc: set foldmethod=syntax When I

  • 0

I use the “syntax” foldmethod 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();
}

I see the following when folded:

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

I like the function body folding, but not the comment-folding. I want to disable it so 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 do I do this? I can see the syntax group that’s relevant with :syn list cComment

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

But tooling around for an hour with the vim documentation and google hasn’t told me how to remove the “fold” attribute from this group.

Is my only recourse really to edit the language syntax file? I suppose it’s less ugly to copy the system syntax file and use this, but I should be able to turn off a specific group with a command in my .vimrc.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T13:42:22+00:00Added an answer on June 1, 2026 at 1:42 pm

    When 'foldmethod' is set to "syntax" then /* */ comments and { } blocks will
    become a fold. If you don’t want comments to become a fold use:

    :let c_no_comment_fold = 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

can I use this syntax under PHP 4 (default function parameter) : function myFunction($arg1
I use this syntax to open my files, since I learned that some years
It's as simple as that, does this line of jQuery use proper syntax? $(this.parentNode
I need to create a multi-dimensional (nested) hashtable/dictionary so that I can use syntax
In SQL Server 2017, you can use this syntax, but not in earlier versions:
i use this javascript syntax for validating a checkbox... alert(document.getElementById(ctl00_ContentPlaceHolder1_Chkreg).checked); if (document.getElementById(ctl00_ContentPlaceHolder1_Chkreg).checked == false)
I am aware that you can use syntax such as: xml..Group And this is
I'd like to use razor syntax inside my Javascript files. Is this possible without
i would like to use this syntax to update a table in access based
Python 2.5 won't let me use this syntax: try: code_that_raises_exception() except Exception as e:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.