From 93b6534ef188dba78f642ec90bfed47ec82b8653 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 3 Jul 2015 21:00:10 +0100 Subject: [PATCH] man.kak: Add basic completion to man command --- rc/man.kak | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rc/man.kak b/rc/man.kak index 95b9986a..957772a5 100644 --- a/rc/man.kak +++ b/rc/man.kak @@ -33,7 +33,14 @@ def -hidden -shell-params _man %{ %sh{ 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" echo "eval -try-client %opt{docsclient} _man $@" } }