Merge remote-tracking branch 'alexherbo2/rc-mime-detection'

This commit is contained in:
Maxime Coste 2019-04-20 10:30:05 +02:00
commit b65fcb5d1a

View File

@ -1,6 +1,7 @@
hook global BufOpenFile .* %{ evaluate-commands %sh{
if [ -z "${kak_opt_filetype}" ]; then
mime=$(file -b --mime-type "${kak_buffile}")
mime=$(file -b -i -L "${kak_buffile}")
mime=${mime%;*}
case "${mime}" in
application/*+xml) filetype="xml" ;;
image/*+xml) filetype="xml" ;; #SVG