Gary,
On Mon, Dec 18, 2000 at 03:58:21PM -0800, Mike E wrote:
> set editor='vim "+set tw=73"'
>
> This automatically sets a 73 column textwrap in vim, so that I no
> longer have to pipe all my email paragraphs through fmt. However, I
> just noticed that if I go back and type on a line, it doesn't
> automatically re-wrap the line, so it looks like I still do have to
> format it through fmt. :/
At 2000/12/18/16:48 -0800 Gary Johnson <[EMAIL PROTECTED]> wrote:
> There's no really good way (i.e., none that I like) to automatically
> reformat paragraphs within vim
Hmmm... Maybe you'll like this. Works for either vi or vim. Define
the following key mapping in .exrc or .vimrc:
map } 0J071lBXi
Notice that the 'i' is followed by a newline and an escape character,
not by '^', 'M', '^', and '['.
Then enter vi(m), position the cursor anywhere on the first line of a
paragraph, and in command mode, press the '}' key repeatedly, with
each press formatting the current line (which advances) so that it is
not more than 72 characters long.
This is my own "text-flow macro". Vary the "71" to your taste. Make
it N - 1, where N is the maximum number of characters per line
acceptable to you.
David
--
Live in a world of your own, but always welcome visitors.