There are a few things I don't understand from your question, such as which foldmethod you are using, or what the number of "rows" refers to, but here's a custom foldtext function that should do roughly what you want:
function! MyFoldText()
let nl = v:foldend - v:foldstart + 1
let comment = substitute(getline(v:foldstart),"^ *","",1)
let linetext = substitute(getline(v:foldstart+1),"^ *","",1)
let txt = '+ ' . linetext . ' : "' . comment . '" : length ' . nl
return txt
endfunction
set foldtext=MyFoldText()
Explanation:
- Find the number of lines contained by the fold.
- Get the "comment" from the line before the first folded line (and remove leading spaces).
- Get the text from the first line of the fold (and remove leading spaces).
- Assemble the above information into the returned foldtext, with appropriate formatting.
Hope this helps. It should be easily tailored to your needs.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…