Well, fair enough. I didn't make any stipulation about ease of use! I run Vim, but perhaps I wasn't using the right nomenclature to find its version of a collapse feature.

Is this an example what you mean?:

FOLDTEXT *fold-foldtext*

'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

Evaluating 'foldtext' is done in the |sandbox|. The current window is set to the window that displays the line. Errors are ignored.


Of have I perhaps headed down the wrong Vim alley?

_________________________
Jim


'Tis the exceptional fellow who lies awake at night thinking of his successes.