I've changed the textwidth
option mid-way through my file and I'd like to reformat the whole buffer to use the new width. What's the quickest way to do this?
views:
873answers:
2
+2
A:
gq<motion>
For example, if your file consists of 100 lines, move to the first line and then press:
gq100<Down Arrow>
You can use the visual mode to select the lines and then press gq
as well.
Alan Haggai Alavi
2009-06-20 18:19:52
So `gg` then `gqG`?
John Kugelman
2009-06-20 18:37:13
Yes, that works too. Shorter!
Alan Haggai Alavi
2009-06-20 19:04:59