Reputation: 8115
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?
Upvotes: 16
Views: 6461
Reputation: 74202
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.
Upvotes: 10