This is a read-only archive!

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 @ 2:41 AM PDT
Cateogory: Linux
Tags: Vim

2 Comments

Bogdano
Quoth Bogdano on March 27, 2008 @ 11:12 PM PDT

Thanks

dum8d0g
Quoth dum8d0g on April 18, 2009 @ 5:26 PM 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 ))