Question

Google is not being very helpful here. I'd like to compose emails with :set spell on, but for all other files, :set spell should be off. I am using mutt, and Vim as the editor for composing emails.

In fact, I'm curious, how does Vim know that it's an email I'm composing? Is there a command-line parameter of the type of file being edited? How does mutt know what to pass in?

Was it helpful?

Solution

You can use an autocmd in your ~/.vimrc that gets triggered by the detected file type:

autocmd FileType mail set spell

OTHER TIPS

Try this in your .muttrc:

set editor = "/usr/bin/vim -c':set spell'"

You can find the correct path to vim with "which vim".

Shouldn't you be using a mutt configuration command? See the following links:

Add the following into your ~/.vimrc:

set spelllang=en_gb,fr
au BufRead,BufNewFile *mutt* set filetype=mail
autocmd FileType mail set spell

And it should work fine. You can (should?) change the spelllang to reflect any languages that your routinely use.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top