mutt for e-mail and I let
vim handle plain text attachments. In my
~/.mailcap I have
text/plain; view %s ; needsterminal
That works fine, but it removes all syntax highlighting. I often receive source code in attachments, and it'd be great to have syntax highlighting. Is there an option that would allow me to preserve it?
I've also tried
vim -R -- %s ; needsterminal in
~/.mailcap but the result is the same.
Put the following in your ~/.muttrc:
That, along with your mailcap rule, worked for me to see a
.diff attachment with syntax highlighting.
Old question, but I thought I'd share my solution;
mailcaprc I've added
text/plain; vim -u <path to my vimrc> - ; needsterminal(the dash is important)
This allows me open the plaintext in vim with my own config by using the
m shortcut when opening the plain-text file as an attachment.