From 0d90f2ed4ba3ca34ddec55847bc5c6c4a84193f9 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 6 Jan 2017 20:04:46 +1300 Subject: Add tab completion settings to ksh --- ksh/kshrc.d/bind.ksh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ksh') diff --git a/ksh/kshrc.d/bind.ksh b/ksh/kshrc.d/bind.ksh index c72a8674..63b46162 100644 --- a/ksh/kshrc.d/bind.ksh +++ b/ksh/kshrc.d/bind.ksh @@ -1,6 +1,7 @@ -# Try to bind ^L to clear the screen +# Try to bind ^I to complete words and ^L to clear the screen case $KSH_VERSION in + # ksh93 is lovely, but complex; rebind ^L so it does the same as Alt-^L *'93'*) bind() { # shellcheck disable=SC2154 @@ -11,12 +12,17 @@ case $KSH_VERSION in trap bind KEYBD ;; + # More straightforward with mksh; bind keys to the appropriate emacs mode + # editing commands *'MIRBSD KSH'*) + bind '^I'='complete' bind '^L'='clear-screen' ;; + # Similar with pdksh; there's a "complete" command, but not a "clear" one, + # so we fake it with clear(1) and some yanking *'PD KSH'*) + bind '^I'='complete' bind -m '^L'='^Uclear^J^Y' ;; - esac -- cgit v1.2.3