On Fri, Oct 30, 2009 at 03:11:16PM -0500, Brandon Metcalf wrote:
> This might be better asked in a vi/vim forum, but I figured someone here
> using mutt has had to solve this problem.  When receiving email from Outlook
> users, lines do not have newline characters.  That is, they show up in mutt
> looking like
> 
>   This is a very long line without newline characters.  This is more of
>   + that long line.
> 
>   This is another paragraph with a long line.  Blah blah blah blah blah
>   + blah blah.
> 
> Has anyone implemented some vim goodness to format these lines so they show
> up like so when replying:
> 
>   > This is a very long line without newline characters.  This is more of
>   > that long line.
> 
>   > This is another paragraph with a long line.  Blah blah blah blah blah
>   > blah blah.

In muttrc:
unset markers
set smart_wrap

In vimrc:
au BufNewFile,BufRead ~/.mutt/.tmp/* set tw=72:ft=mail

Then in vim I type gwap or gq} or gq$.

I guess it's more semiautomatic than automatic.

> 
> I tried setting my editor to use fmt(1) and pipe that to vim but I couldn't
> get it to work properly.  fmt(1) was treating the entire message as one big
> paragraph and the output was mangled.

To avoid the "one big paragraph" try gq$.

In the vimrc line above replace "~/.mutt/.tmp/" with whatever your mutt
tmpdir is.

-- 
Monte

Reply via email to