The chapter 28 of User Manual says the following about folding: Folding is used to show a range of lines in the buffer as a single line on the screen.And all the examples of folding that I've seen converts several lines to only one.What I'm trying to do is to create a folding within one line. For example if I have the following line:MyFunction (with, really, a, lot, of, parameters, which, make, my, line, too, long)I'd like to be able to fold it this way:MyFunction (+-- folded)So far I have tried different things with no success:I know that it's possible to use set foldmethod=marker to add marker in the text to fold lines to it doesn't seem to work within a line. For example the following doesn't work:MyFunction ( /*{{{*/ with, really, a, lot, of, parameters, which, make, my, line, too, long /*}}}*/)I also know that it is possible to create folding using text objects: for example to fold a paragraph it is possible to use zfap where zf is the command to create a folding and ap the text object to fold. I've tried to extend that with zfi(, zfa(, zfib or zfab but that give the following:MyFunction (with, really, a, lot, of, parameters, which, make, my, line, too, long)/*{{{*//*}}}*/Finally I tried it with visual selection: vib and zf but the result is the same as the previous method.So my questions are:Is it possible to use folding within a line? From what I have tried I think that folds might not be the good way to do itIf so, how can I do it?If it is not possible with foldings, what should I try to use to get my result? A bonus point would be to have a method which wouldn't need to add markers like /*{{{*/ and /*}}}*/ in my buffer but if it's the only way to do it I'm ok with that.
Is it possible to create a folding inside a single line?
folding;formatting
You can hack around with some custom syntax and the use of the conceal:syntax region FunctionArguments start=+(+hs=e+1 end=+)+he=e-1 conceal cchar=set concealleval=1e.g.function (a, b, c, d, e)function ()Careful though, with this basic example, all () will be concealed, so a little more work must be done here, but it should be a good opportunity to learn.Here, the content is hidden and replaced with the  char.Unfortunately, you can't display more than one char with the conceal feature.The good news is you can apply new syntax to file without having to define a new syntax, so you can embed this in a function to activate-deactivate it.