<<< Date Index >>>     <<< Thread Index >>>

Re: mutt or vi question..



On 2004-04-05, David Bear <David.Bear@xxxxxxx> wrote:
> I'm constantly receive mails from those with horrible mua's like
> outlook express where the lines are very very long.
> 
> is there a mutt/vi way to re-wrap those lines at 70 col?

In mutt, wrapping is controlled by three configuration variables: 
'markers', 'smart_wrap' and 'wrapmargin'.  'Smart_wrap' is set by
default, so you shouldn't have to mess with that.  'Markers' is also
set by default, but I prefer not to see the markers, so I unset it. 
The column at which the lines wrap is controlled by 'wrapmargin',
which sets the width of the right margin, i.e., the number of
columns between the last word on the line and the right side of the
terminal window.  If you never change the width of the terminal in
which you run mutt, just subtract 70 from its width and set that as
your 'wrapmargin'.  If the width varies, but is never less than 70,
and if you use a shell that supports such expression evaluations,
the following will work to set the line width to 70:

    set wrapmargin=`echo $(( $COLUMNS - 70 ))`

I don't think there is a way to wrap those lines the way you want in
pure vi.  Vim will wrap lines at word boundaries, but it still
doesn't wrap the lines anywhere but at the right edge of the screen,
unless you want to actually reformat the lines.  Assuming for now
that you just want to affect the way lines are displayed without
reformatting them, and assuming that you are using vim, take a look
at

    :help linebreak
    :help breakat
    :help showbreak

If you want to reformat the lines, take a look at

    :help formatting
    :help gq
    :help 10.7

> I like the way emacs does it will fill-region.  Anything comparable?

Since I don't use emacs, I can't say.  What does fill-region do?

HTH,
Gary

-- 
Gary Johnson                               | Agilent Technologies
garyjohn@xxxxxxxxxxxxxxx                   | Wireless Division
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA