kakoune/rc/base/mail.kak
Martin Chaine 74432ac8f2 match filetype for eml extension
stolen from #878
2016-12-06 17:53:12 +01:00

16 lines
548 B
Plaintext

hook global BufCreate .+\.eml %{
set buffer filetype mail
}
hook global BufSetOption mimetype=message/rfc822 %{
set buffer filetype mail
}
addhl -group / group mail
addhl -group /mail regex ^(From|To|Cc|Bcc|Subject|Reply-To|In-Reply-To):([^\n]*(?:\n\h+[^\n]+)*)$ 1:keyword 2:attribute
addhl -group /mail regex <[^@>]+@.*?> 0:string
addhl -group /mail regex ^>.*?$ 0:comment
hook -group mail-highlight global WinSetOption filetype=mail %{ addhl ref mail }
hook -group mail-highlight global WinSetOption filetype=(?!mail).* %{ rmhl mail }