From e68f3cfe353b50eeae380d0ae21bb5fb7c974a1a Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 11 Apr 2013 23:09:42 +0200 Subject: [PATCH] git-tools.kak: initial git-show command --- src/rc/git-tools.kak | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/rc/git-tools.kak b/src/rc/git-tools.kak index f7a03023..57d15624 100644 --- a/src/rc/git-tools.kak +++ b/src/rc/git-tools.kak @@ -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${tmpfile}gk + nop %sh{rm ${tmpfile}} + setb filetype diff" + else + echo "echo %{git show '$@' failed, see *debug* buffer}" + rm ${tmpfile} + fi +}}