How can I get mutt to stop making vim insert line breaks every few characters?

Every time I type an email with mutt, it inserts these line breaks every 70 characters or so. I'd rather it just relied on word wrap instead, since my editing style (lots of revision) makes reformatting a pain. Is there a way to set this up in muttrc?


Solution 1:

You can set the editor option in your .muttrc option and include command line options. The command line options can set vim settings. An example would be:

set editor="vim +':set textwidth=0' +':set wrapmargin=0' +':set wrap'"

or

# use vim, tell it to set cursor on first line of body
set editor="vim -c 'set expandtab textwidth=65 | normal }j'"

And so on and so forth. See the vim man page for many more options.

Solution 2:

Another approach is to specify an extra source file just for mutt with vim's -S cli flag:

Here is the value of editor in my .muttrc:

set editor="vim -S ~/.mutt/vimrc"

And then here is my ~/.mutt/vimrc:

set textwidth=0
set wrapmargin=0