[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mutt and vim just will not play nice for me :-(



* Patrick Kirk (patrick@kirks.net) [020402 23:11]:
> Hi all,
> 
> When I post from mutt, my mails are really ugly because I can't get it
> to text wrap.
> 
> In .vimrc I have the setting:
> au FileType mail set tw=70 fo=tcrq2 nomodeline
> 
> It was provided by wayne Topa.
> 
> In .muttrc I have this:
> set editor="vim -c 'set filetype=mail'" # Must wrap mail
> 
> Has anyone got this combo working right?  Because mutt won't wrap at
> all.

Which version of vim are you using? I use the following with vim 6.1:

from .vimrc:
===========
autocmd FileType mail call FT_mail()

function FT_mail()
  set textwidth=72
  /^$
endfunction
===========

I haven't changed mutt's editor setting which uses /usr/bin/editor
(which is a symlink to a symlink to /usr/bin/vim, which gets run with no
arguments whatsoever).

Setting editor="/usr/bin/vim -V" in mutt can help diagnose your problem
as well, to see which filetype plugins it's running. Actually, just
having done that, I realize that my vim looks for mail.vim in various
places; the cleanest setup is probably just to put those commands in
there. (/me tries it.) Yep, that worked! So all I had to do was put
these 2 lines:

set textwidth=72
/^$

in ~/.vim/ftplugin/mail.vim and it Just Works. (I also removed the
entire portion of my .vimrc that I had quoted above. also, the second
line isn't necessary for textwidth wrapping, it just starts the cursor
on the first blank line -- right after the headers.)

good times,
Vineet

-- 
Currently seeking opportunities in the SF Bay Area
Please see http://www.doorstop.net/resume.shtml

Attachment: pgpuYrPMM238g.pgp
Description: PGP signature


Reply to: