When I dump Python code in vim, the fold text always starts from scratch. This is visually noisy since Python has significant gaps - it looks like top-level code when I view the file.
Is there a parameter to tell the word foldtext to fall back to the level of the first line of the folded code without overwriting the foldtext () method?
The way to influence this is with the help of the 'foldtext' option.
'foldtext'
Here is a simple example to get you started:
:setlocal foldtext=repeat('\ ',indent(v:foldstart)).foldtext()