aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-01-06 20:06:24 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-01-06 20:06:24 +1300
commit1eafda0e06894527019f334a64750cd9fcd39821 (patch)
tree960c8ee85e03183022eb54e236745d4126fd1322
parentAppease ShellCheck (diff)
parentRename keyboard trap func less ambiguously (diff)
downloaddotfiles-1eafda0e06894527019f334a64750cd9fcd39821.tar.gz
dotfiles-1eafda0e06894527019f334a64750cd9fcd39821.zip
Merge branch 'master' into port/bsd/freebsd
-rw-r--r--ksh/kshrc.d/bind.ksh14
1 files changed, 10 insertions, 4 deletions
diff --git a/ksh/kshrc.d/bind.ksh b/ksh/kshrc.d/bind.ksh
index c72a8674..34cb5f5a 100644
--- a/ksh/kshrc.d/bind.ksh
+++ b/ksh/kshrc.d/bind.ksh
@@ -1,22 +1,28 @@
-# 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() {
+ keybd_trap() {
# shellcheck disable=SC2154
case ${.sh.edchar} in
$'\f') .sh.edchar=$'\e\f' ;;
esac
}
- trap bind KEYBD
+ trap keybd_trap 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