mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-26 21:22:00 +03:00
Merge remote-tracking branch 'Eluminae/master'
This commit is contained in:
commit
40270a9c8b
@ -1,4 +1,4 @@
|
||||
hook global BufOpenFile .* %{ evaluate-commands %sh{
|
||||
define-command -hidden file-detection %{ evaluate-commands %sh{
|
||||
if [ -z "${kak_opt_filetype}" ]; then
|
||||
mime=$(file -b --mime-type -L "${kak_buffile}")
|
||||
mime=${mime%;*}
|
||||
@ -9,6 +9,7 @@ hook global BufOpenFile .* %{ evaluate-commands %sh{
|
||||
text/x-shellscript) filetype="sh" ;;
|
||||
text/x-script.*) filetype="${mime#text/x-script.}" ;;
|
||||
text/x-*) filetype="${mime#text/x-}" ;;
|
||||
text/plain) exit ;;
|
||||
text/*) filetype="${mime#text/}" ;;
|
||||
application/x-shellscript) filetype="sh" ;;
|
||||
application/x-*) filetype="${mime#application/x-}" ;;
|
||||
@ -20,3 +21,6 @@ hook global BufOpenFile .* %{ evaluate-commands %sh{
|
||||
fi
|
||||
fi
|
||||
} }
|
||||
|
||||
hook global BufOpenFile .* file-detection
|
||||
hook global BufWritePost .* file-detection
|
||||
|
Loading…
Reference in New Issue
Block a user