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:
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.