diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-01-06 20:06:24 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-01-06 20:06:24 +1300 |
commit | 1eafda0e06894527019f334a64750cd9fcd39821 (patch) | |
tree | 960c8ee85e03183022eb54e236745d4126fd1322 | |
parent | Appease ShellCheck (diff) | |
parent | Rename keyboard trap func less ambiguously (diff) | |
download | dotfiles-1eafda0e06894527019f334a64750cd9fcd39821.tar.gz dotfiles-1eafda0e06894527019f334a64750cd9fcd39821.zip |
Merge branch 'master' into port/bsd/freebsd
-rw-r--r-- | ksh/kshrc.d/bind.ksh | 14 |
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 |