summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2019-08-30 16:50:03 +0200
committerAlan Pearce2019-08-30 16:50:03 +0200
commit3ea4e2fe6b599958d1f17722613fa1b28bd4f7f3 (patch)
tree94815fb4bd58ec45b52d4dcb957e896729874abd
parent9f5f996b0034949f447ecab9c5d3ab1a3c6794e7 (diff)
downloaddotfiles-3ea4e2fe6b599958d1f17722613fa1b28bd4f7f3.tar.lz
dotfiles-3ea4e2fe6b599958d1f17722613fa1b28bd4f7f3.tar.zst
dotfiles-3ea4e2fe6b599958d1f17722613fa1b28bd4f7f3.zip
zsh: improve argument-killing widgets
-rw-r--r--zsh/.config/zsh/.zshrc8
1 files changed, 7 insertions, 1 deletions
diff --git a/zsh/.config/zsh/.zshrc b/zsh/.config/zsh/.zshrc
index ea696e7..9be59a1 100644
--- a/zsh/.config/zsh/.zshrc
+++ b/zsh/.config/zsh/.zshrc
@@ -87,17 +87,23 @@ forward-argument () {
   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]}