When a fold is collapsed in vim, all of the nested headings are hidden away so that you can't see what's inside. I'm curious if anyone knows if it's possible or has a solution for foldtext
function (or through another method) that can display the sections inside a fold when a fold is collapsed.
I'm looking for something that would display folds more like this:
+ -- 2000 TopSection1 " Fold Level 1
+ --- 500 TopSection1 : ChildSection1 " Fold Level 2
+ ---- 50 TopSection1 : ChildSection1 : BottomSection1 " Fold Level 3
+ --- 100 TopSection1 : ChildSection2 : BottomSection1 " Fold Level 2
+ -- 500 TopSection2 " Fold Level 1
+ --- 25 TopSection2 : ChildSection1 " Fold Level 2
I've been digging around, but have not figured out a method to make this work (or if it's possible). Any suggestions?
You will have to play with
foldtext
but also to parse the content of the section to fetch what you want to display.