Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I've recently switched to Mutt, and am using vim as my main editor, which is working quite well. My only minor annoyance is that I would like to, in addition to the various highlights and such done my vim's mail filetype, also get syntax highlighting for markdown.

Google has proven not to be up to the challenge, so I was hoping I might find someone here with some further knowledge of the powers of vim.

I could just set the filetype to be markdown for /tmp/mutt*, but the mail filetype does some magic beyond merely the body of the email as far as I can tell?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Do you send out Markdown-formatted emails?!

It's difficult to have both Mail and Markdown formatting; you can't just "add" another syntax to an existing one. Vim allows to designate certain regions and include another syntax in there (see :help :syn-include), but I don't think that would work out well. (Unless you can ignore quoted messages and just define a region for the entire mail body.)

If you just have blocks of Markdown embedded in email messages, you can use my SyntaxRange plugin to highlight a range of lines (either by manually specifying it, or when it's delimited by certain markers). I use this to highlight diff blocks of inline patches.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.