Word wrap in Vim

How to word-wrap a whole document at once (to 79 characters, in this example):

:set tw=79
:set fo=t
1GVGgq
August 11, 2006 @ 9:41 AM PDT
Cateogory: Linux
Tags: Vim

2 Comments

Bogdano
Quoth Bogdano on March 28, 2008 @ 6:12 AM PDT

Thanks

dum8d0g
Quoth dum8d0g on April 19, 2009 @ 12:26 AM PDT

Instead of '1GVGgq' you can use 'gggqG'. Using visual ('VG') may be slower. (( gg - go to top, gq - reformat to.., G - go to bottom ))

Speak your Mind

You can use Markdown in your comment.
Email/URL are optional. Email is only used for Gravatar.

Preview