[PLUG] some awk-fu or perl to word wrap a text file?

Dan Young danielmyoung at gmail.com
Wed Oct 17 15:04:22 UTC 2007


On 10/17/07, Paul Heinlein <heinlein at madboa.com> wrote:
> The added bonus is that fmt works great within vi(m). For instance, to
> wrap a really long line of text, get the cursor to the beginning of
> the line and (in command mode) type
>
> :.!fmt
>
> Or if you've got a paragraph with a really ragged right side, position
> the cursor at the beginning of the paragraph and (in command mode)
> type
>
> !}fmt

Or use Vim's text formatting command:

"To tell Vim to format the current paragraph:

	gqap

This starts with the "gq" command, which is an operator.  Following is
"ap", the text object that stands for "a paragraph".  A paragraph is
separated from the next paragraph by an empty line."

--
Dan



More information about the PLUG mailing list