With foldmethod=indent, I can create folds based on the indentation level, e.g. this
- foo
- bar
- baz
- qux
would be folded into this:
- foo
+ -- 2 lines folded ------------------------------------------------------------
- qux
Is it possible to include the first line of the previous level into the fold? That is,
+ -- 3 lines folded ------------------------------------------------------------
- qux
:help fold.txt; I think you'll have to usefoldmethod=exprand write a smallfoldexprfunction (e.g. count shiftwidth() of current line + count shiftwidth() of next line). – Martin Tournoij Aug 17 '22 at 17:21