git-tools.kak: Add completion support to git command

This commit is contained in:
Maxime Coste 2014-08-14 19:42:24 +01:00
parent fbbe741c07
commit 2d42783dbd

View File

@ -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