I have XML which looks like this:
<object>
<object>
a
</object>
<object>
b
</object>
</object>
and to edit it more easily, I would like to use folding, but when I try set foldmethod=indent
it does nothing. Possible it have something to do with that my xml is indented with two spaces, not four, but I'm not sure about that.
How to turn on indenting for such file properly?
You should bear in mind that the foldlevel is computed from the indent of the line, divided by the
shiftwidth
& rounded down. If you haven't set sw
correctly, VIM might never create a fold where you expect it to.
Setting :set sw=2
should give you the expected results.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With