On 2014-11-19, Dale wrote:
> On Wed, Nov 19, 2014 at 08:34:15PM +0000, John Long wrote:
> > On Wed, Nov 19, 2014 at 03:15:15PM -0500, Dale wrote:
> > > read in the docs and on google
> > > 
> > > this line in my ~/.slrnrc
> > > set editor="vim +':set textwidth=0' +':set wrapmargin=0' +':set wrap'"
> > > 
> > > seems to wraps when I type or copy/paste into vim
> > 
> > Problem solved!
> 
> not yet, when I type, as opposed to cut/paste, it wraps but it puts a plus 
> sign in front of each line, this would be especially troublesome with URLs

There are two senses in which Vim wraps text.

One is that with 'wrap' on, Vim will wrap lines in the display so
that all characters appear in the display and none extend beyond the
right side of the display.

You can see this by typing a line longer than than the width of
Vim's display and alternately setting 'wrap' and 'nowrap'.  Note
that the characters in the line are not affected by these settings.
Note also that the point at which the line is wrapped is the right
side of the display and that this point is not affected by either
'textwidth' or 'wrapmargin'.

The other sense is that of adjusting the lengths of lines themselves
so that they are not longer than some limit.  To do this, Vim adds
and removes newlines in the text so that lines are within the
limits set by 'textwidth' or 'wrapmargin'.

The rules Vim uses to determine when to break a line by inserting a
newline are a little complicated and are affected by the setting of
'formatoptions'.  In most cases, Vim just automatically inserts a
newline where it seems that it should.  If the formatting doesn't
look right to you, executing

    gqap

will re-format the current paragraph and usually adjusts the lines
the way you think it should.

For more on this, see

    :help 25.1
    :help 25.4
    :help 'formatoptions'
    :help 'fo-table'
    :help gq

The problem you seem to be having is that you are configuring Vim to
wrap the display of the lines you enter, but not wrap them by
inserting actual line breaks.  Therefore the lines you enter are
really long and unbroken and therefore appear with a leading + when
displayed by mutt.

If you want Vim to actually break lines so that they are not longer
than, say, 72 characters, use

    :set wrapmargin=0
    :set textwidth=72

The default settings of 'formatoptions' are probably fine unless you
run into further problems that changing those settings might fix.

HTH,
Gary

----------
Note to purists:  I know that Vim doesn't really insert newlines
into the text as some other editors would, but in most cases it
appears to and the I think the explanation is close enough in this
case.

Reply via email to