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=expr
and write a smallfoldexpr
function (e.g. count shiftwidth() of current line + count shiftwidth() of next line).