From 8651b073eb07386282f429a677eb425ea842d78a Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Fri, 21 Oct 2022 01:16:03 +0200 Subject: [PATCH] zsh:keys: Rely more on terminfo and use libtermkey Introduce first mapping that follows the 'fixed keyboard input'[^1] sequences. They allow the differentiation of all keys with each modifier without gotchas like `tab` send the same sequence as `ctrl-i`. [^1] - https://www.leonerd.org.uk/hacks/fixterms/ --- .config/zsh/zshrc.d/60-keys.zsh | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/.config/zsh/zshrc.d/60-keys.zsh b/.config/zsh/zshrc.d/60-keys.zsh index 3431b57..bd188b6 100644 --- a/.config/zsh/zshrc.d/60-keys.zsh +++ b/.config/zsh/zshrc.d/60-keys.zsh @@ -49,21 +49,17 @@ bindkey '^E' edit-command-line bindkey '^S' vi-pound-insert ## Navigation -bindkey '^[[Z' reverse-menu-complete # shift-tab -bindkey '^Q' push-input # ctrl-Q -bindkey '^[[H' vi-beginning-of-line # home -bindkey "$terminfo[khome]" vi-beginning-of-line # home -bindkey '^[[F' vi-end-of-line # end -bindkey "$terminfo[kend]" vi-end-of-line # end -bindkey '^?' vi-backward-delete-char # backspace -bindkey '^[[P' vi-delete-char # delete -bindkey '^[[3~' vi-delete-char # delete -bindkey '^[[1;5D' vi-backward-word # ctrl-left -bindkey '^[[1;5C' vi-forward-word # ctrl-right -bindkey '^W' vi-backward-kill-word # ctrl-W -bindkey '^H' vi-backward-kill-word # ctrl-backspace -bindkey '^[[3;5~' vi-kill-word # ctrl-delete -bindkey "$terminfo[kmous]" vi-kill-word # ctrl-delete +bindkey "$terminfo[kcbt]" reverse-menu-complete # shift-tab +bindkey "$terminfo[khome]" vi-beginning-of-line # home +bindkey "$terminfo[kend]" vi-end-of-line # end +bindkey "$terminfo[kbs]" vi-backward-delete-char # backspace +bindkey "$terminfo[kdch1]" vi-delete-char # delete +bindkey '^[[127;5u' vi-backward-kill-word # ctrl-backspace +bindkey '^W' vi-backward-kill-word # ctrl-W +bindkey '^[[1;5D' vi-backward-word # ctrl-left +bindkey '^[[1;5C' vi-forward-word # ctrl-right +bindkey '^[[3;5~' vi-kill-word # ctrl-delete +bindkey '^Q' push-input # ctrl-Q # Open file in EDITOR selected with fzf function edit-fuzzy-file {