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 214955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:25:26+00:00 2026-05-11T18:25:26+00:00

Let’s assume you have a cursor at a closed fold as in the picture.

  • 0

Let’s assume you have a cursor at a closed fold as in the picture.

alt text http://dl.getdropbox.com/u/175564/foldEdit.png

How can you edit the title of SMALLAPPS without opening the fold in Vim?

  • 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-05-11T18:25:26+00:00Added an answer on May 11, 2026 at 6:25 pm

    Do you want to edit the first line of the folded block, or the string that appears when the fold is closed? If it’s the former, I don’t think you can do it without opening the fold. If it’s the latter, then have a look at the foldtext option. It can be any expression. This expression is evaluated to create this string.

    From the docs:

    ‘foldtext’ is a string option that
    specifies an expression. This
    expression is evaluated to obtain the
    text displayed for a closed fold.
    Example:

    :set foldtext=v:folddashes.substitute(getline(v:foldstart),'/\\*\\\|\\*/\\\|{{{\\d\\=','','g')
    

    This shows the first line of the fold,
    with “/“, “/” and “{{{” removed.
    Note the use of backslashes to avoid
    some characters to be interpreted by
    the “:set” command. It’s simpler to
    define a function and call that:

    :set foldtext=MyFoldText()
    :function MyFoldText()
    :  let line = getline(v:foldstart)
    :  let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
    :  return v:folddashes . sub
    :endfunction
    

    An alternative is using the marker folding method. With it, you can enter any string before the fold marker and it will appear when the fold is closed.

    From the docs:

    Markers in the text tell where folds
    start and end. This allows you to
    precisely specify the folds. This
    will allow deleting and putting a
    fold, without the risk of including
    the wrong lines. The ‘foldtext’
    option is normally set such that the
    text before the marker shows up in the
    folded line. This makes it possible to
    give a name to the fold.

    Markers can have a level included, or
    can use matching pairs. Including a
    level is easier, you don’t have to add
    end markers and avoid problems with
    non-matching marker pairs. Example:

    /* global variables {{{1 */
    int varA, varB;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have two text files that I need to extract data out
Let's say I have a 1 GB text file and I want to read
Let's say I query for http://images.google.com.sg/images?q=sky&imgcolor=black and I get all the black color sky,
Let's assume I have the following typedef: typedef void (^myBlock)(id); And I have some
Let's have an example like below: package xliiv.sandbox; import android.app.Activity; import android.os.Bundle; import android.util.Log;
Let's say I don't have photoshop, but I want to make pattern files (.pat)
Let's say I have a method in java, which looks up a user in
Let me explain best with an example. Say you have node class that can
Let me try to explain by example. Say website is hosted at example.com (NOT
Let's say I have a table with a Color column. Color can have various

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.