In vim I can set the textwidth option and then new text is formatted to wrap. I can also use the "gq" command to explicitly wrap text. However, the behaviour with bulleted lists is a bit unexpected to me. The vim docs talk about using bulleted lists with hyphens for the bullets. When I try to do this, it starts okay:
- This is a bulleted list item that
has been wrapped. It looks good.
However, if I continue onto a third line, it gives up on the indent:
- This is a bulleted list item that
has been wrapped over more than
two lines. The indentation for lines
after the second is unexpected.
This happens with:
formatoptions=tcq
comments=s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-
Just to be clear, I would like indentation like this:
- This is a bulleted list item that
has been wrapped over more than
two lines. I want every line after
the first to get the same indent.
After further investigation, it looks like I just needed to do "set autoindent" to get the expected behaviour. This seems to work well both for wrapping of text as it it typed and wrapping with the "gq" command.
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