From 2d42783dbdb172aa4c78a51074c3b476f8140e74 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 14 Aug 2014 19:42:24 +0100 Subject: [PATCH] git-tools.kak: Add completion support to git command --- rc/git-tools.kak | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rc/git-tools.kak b/rc/git-tools.kak index a34022c7..ac76e2f1 100644 --- a/rc/git-tools.kak +++ b/rc/git-tools.kak @@ -24,6 +24,15 @@ decl line-flag-list git_diff_flags def -shell-params \ -docstring "git wrapping helper" \ + -shell-completion %{ + shift $(expr ${kak_token_to_complete}) + prefix=${1:0:${kak_pos_in_token}} + ( + for cmd in show log diff status blame hide-blame show-diff update-diff checkout add; do + expr "${cmd}" : "^\(${prefix}.*\)$" + done + ) | grep -v '^$' + } \ git %{ %sh{ show_git_cmd_output() { local filetype