1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-23 15:23:29 +03:00

git-tools.kak: initial git-show command

This commit is contained in:
Maxime Coste 2013-04-11 23:09:42 +02:00
parent 1b5760f1a1
commit e68f3cfe35

View File

@ -55,3 +55,16 @@ def git-blame %{
done; send_flags )
) >& /dev/null < /dev/null & }
}
def -shell-params git-show %{ %sh{
tmpfile=$(mktemp /tmp/kak-git-show-XXXXXX)
if git show "$@" > ${tmpfile}; then
echo "edit! -scratch *git-show*
exec |cat<space>${tmpfile}<ret>gk
nop %sh{rm ${tmpfile}}
setb filetype diff"
else
echo "echo %{git show '$@' failed, see *debug* buffer}"
rm ${tmpfile}
fi
}}