aboutsummaryrefslogtreecommitdiff
path: root/ksh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-01-06 20:04:46 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-01-06 20:04:46 +1300
commit0d90f2ed4ba3ca34ddec55847bc5c6c4a84193f9 (patch)
tree1aa99b39ce1432ba700c66c274d1c0a5f79c38bc /ksh
parent0e370365bbc200941195b1255cf71d4a7d807d6f (diff)
downloaddotfiles-0d90f2ed4ba3ca34ddec55847bc5c6c4a84193f9.tar.gz
Add tab completion settings to ksh
Diffstat (limited to 'ksh')
-rw-r--r--ksh/kshrc.d/bind.ksh10
1 files changed, 8 insertions, 2 deletions
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