2013-02-21 13:36:25 +01:00
|
|
|
hook global BufOpen .* %{ %sh{
|
|
|
|
mimetype="$(file -b --mime-type ${kak_bufname})"
|
|
|
|
if [[ "${mimetype}" == "message/rfc822" ]]; then
|
2013-10-30 10:38:40 +01:00
|
|
|
echo set buffer filetype mail;
|
2013-02-21 13:36:25 +01:00
|
|
|
fi
|
|
|
|
} }
|
|
|
|
|
|
|
|
hook global WinSetOption filetype=mail %~
|
|
|
|
addhl group mail-highlight
|
|
|
|
addhl -group mail-highlight regex ^(From|To|Cc|Bcc|Subject|Reply-To|In-Reply-To):([^\n]*(?:\n\h+[^\n]+)*)$ 1:keyword 2:attribute
|
|
|
|
addhl -group mail-highlight regex <[^@>]+@.*?> 0:string
|
|
|
|
addhl -group mail-highlight regex ^>.*?$ 0:comment
|
|
|
|
~
|
|
|
|
|
|
|
|
hook global WinSetOption filetype=(?!mail).* %{
|
|
|
|
rmhl mail-highlight
|
|
|
|
}
|