man.kak: Add basic completion to man command

This commit is contained in:
Maxime Coste 2015-07-03 21:00:10 +01:00
parent b7be43f9b9
commit 93b6534ef1

View File

@ -33,7 +33,14 @@ def -hidden -shell-params _man %{ %sh{
fi fi
} } } }
def -shell-params man %{ %sh{ def -shell-params \
-shell-completion %{
prefix=${1:0:${kak_pos_in_token}}
for page in /usr/share/man/*/${prefix}*.1.gz; do
basename $page .1.gz
done
} \
man %{ %sh{
[ -z "$@" ] && set -- "$kak_selection" [ -z "$@" ] && set -- "$kak_selection"
echo "eval -try-client %opt{docsclient} _man $@" echo "eval -try-client %opt{docsclient} _man $@"
} } } }