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

Re: OT: column 72 in mutt with xterm && vim



Hi Kyle!

On Wed, 12 Mar 2008, Kyle Wheeler wrote:
> On Wednesday, March 12 at 10:06 PM, quoth Dilip M:
> > But still it is not automatic. I mean, when I reply to emails, I always to 
> > visual selection and press q (I have alised it as 'q gq}'.
> 
> That's not what he meant by "automatic" - what he meant was that vim 
> should know that the filetype (ft) is "mail" without you having to 
> specify it.

Right. That's what I meant. Sorry for the confusion.

> BUT, if it helps, you *can* have vim automatically keep your lines to 
> within 72 characters as you type. Add "a" to your fo, like so:
> 
>      set editor="vim -c 'set fo=tcrqa ft=mail ff=unix tw=74'"

By the way, instead of specifying a lengthy set editor option in your
muttrc, you can also write your mail settings in a separate file and
let vim source it, whenever it detects the filetype mail.

Create a file called mail.vim below ~/.vim/after/ftplugin/ (create missing
directories) and insert:

,---- 
| setl fo+=a tw=74 ff=unix
`----

And whenever vim reads a file of filetype mail, it will also source the
corresponding file in your ftplugin directory (If you have enabled
filetype specific settings with :filetype plugin on anywhere in your 
.vimrc). For reference see 

:h after-directory
:h ftplugin-overrule
:h filetype

(By the way, I just tried setl fo+=a, but I did not like it, cause it
keeps on joining files that I want to keep separate)

regards,
Christian
-- 
hundred-and-one symptoms of being an internet addict:
88. Every single time you press the 'Get mail' button...it does get new mail.