From 6458a4546193a684ff89b3c2be1dc4200cb9c0d7 Mon Sep 17 00:00:00 2001 From: Julian Prein Date: Mon, 9 May 2022 19:35:12 +0200 Subject: [PATCH] zsh:keys: Bind `^W` to `backward-kill-word` For deleting a word while in the shell, I find it easier/faster to use emacs bindings or Ctrl-Backspace and backward-kill-word instead of the vi version. In tmux, Ctrl-H (same esacape sequnce as Ctrl-Backspace) is used for switching panes since f11b7fa56545 ("vim,tmux:plugs: Add `vim-tmux-navigator`"), so I need to use Ctrl-W. As that is bound to vi-backword-kill-word, rebind it to use the emacs version. --- .config/zsh/zshrc.d/60-keys.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/.config/zsh/zshrc.d/60-keys.zsh b/.config/zsh/zshrc.d/60-keys.zsh index 859bdf6..ea79e8e 100644 --- a/.config/zsh/zshrc.d/60-keys.zsh +++ b/.config/zsh/zshrc.d/60-keys.zsh @@ -60,6 +60,7 @@ bindkey '^[[P' delete-char # delete bindkey '^[[3~' delete-char # delete bindkey '^[[1;5D' backward-word # ctrl-left bindkey '^[[1;5C' forward-word # ctrl-right +bindkey '^W' backward-kill-word # ctrl-W bindkey '^H' backward-kill-word # ctrl-backspace bindkey '^[[3;5~' kill-word # ctrl-delete bindkey "$terminfo[kmous]" kill-word # ctrl-delete