all repos — nixfiles @ 3ea4e2fe6b599958d1f17722613fa1b28bd4f7f3

System and user configuration, managed by nix and home-manager

zsh: improve argument-killing widgets
Alan Pearce alan@alanpearce.eu
Fri, 30 Aug 2019 16:50:03 +0200
commit

3ea4e2fe6b599958d1f17722613fa1b28bd4f7f3

parent

9f5f996b0034949f447ecab9c5d3ab1a3c6794e7

1 files changed, 7 insertions(+), 1 deletions(-)

jump to
M zsh/.config/zsh/.zshrczsh/.config/zsh/.zshrc
@@ -87,17 +87,23 @@ local WORDCHARS="\!\`~#@$%^&*()-_=+[{]}\|;:,<.>/?\'\""   zle forward-word
 }
 
+backward-kill-argument () {
+  local WORDCHARS="\!\`~#@$%^&*()-_=+[{]}\|;:,<.>/?\'\""
+  zle backward-kill-word
+}
+
 kill-argument () {
   local WORDCHARS="\!\`~#@$%^&*()-_=+[{]}\|;:,<.>/?\'\""
-  zle backward-argument
   zle kill-word
 }
 
 zle -N backward-argument
 zle -N forward-argument
 zle -N kill-argument
+zle -N backward-kill-argument
 bindkey '\e^b' backward-argument
 bindkey '\e^f' forward-argument
+bindkey '\e^d' backward-kill-argument
 bindkey '\e^k' kill-argument
 
 sort=${commands[gsort]:-$commands[sort]}