Monday, August 13, 2007

VIM - format lines to certain width

First,
:set textwidth=80 (or :set tw=80)
Then,
gqqFormat a single line
{Visual}gqFormat visual selection. (ctrl+v to get to visual mode then use hjkl to navigate)

For more help,
:help gq