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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user