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. :/

There's no really good way (i.e., none that I like) to automatically
reformat paragraphs within vim, but there are some things you can do to
make it easier.  For example, you can use vim's internal formatter to
reformat the current paragraph by typing

    gqip

Or, if you prefer to use fmt, you can put something like this in your
.vimrc:

    au BufNewFile,BufRead,BufEnter *                set equalprg=
    au BufNewFile,BufRead,BufEnter /tmp/mutt-*      set equalprg=fmt

and reformat the current paragraph with

    =ip

Of course you can use object/motion commands other than "ip", but you
get the idea.

Gary

-- 
Gary Johnson                 | Agilent Technologies
[EMAIL PROTECTED]     | RF Communications Product Generation Unit
                             | Spokane, Washington, USA

Reply via email to