summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2016-07-14 10:49:36 +0200
committerAlan Pearce2016-07-14 10:49:36 +0200
commitd373f6e27091bde2553466a83766fc096982be9e (patch)
tree040527c66985e844d83cdb8eef5088f74f5d9e87
parentb6464ffdea4578828c9abdf3b3d2dd2799676f85 (diff)
downloaddotfiles-d373f6e27091bde2553466a83766fc096982be9e.tar.lz
dotfiles-d373f6e27091bde2553466a83766fc096982be9e.tar.zst
dotfiles-d373f6e27091bde2553466a83766fc096982be9e.zip
zsh: Add argument-wise word commands
-rw-r--r--tag-zsh/config/zsh/zshrc23
1 files changed, 23 insertions, 0 deletions
diff --git a/tag-zsh/config/zsh/zshrc b/tag-zsh/config/zsh/zshrc
index 9a85643..6e034e9 100644
--- a/tag-zsh/config/zsh/zshrc
+++ b/tag-zsh/config/zsh/zshrc
@@ -55,6 +55,29 @@ alias llr="ll -t"
 
 bindkey '\e[3~' delete-char
 
+backward-argument () {
+	local WORDCHARS="\!\`~#@$%^&*()-_=+[{]}\|;:,<.>/?\'\""
+	zle backward-word
+}
+
+forward-argument () {
+	local WORDCHARS="\!\`~#@$%^&*()-_=+[{]}\|;:,<.>/?\'\""
+	zle forward-word
+}
+
+kill-argument () {
+	local WORDCHARS="\!\`~#@$%^&*()-_=+[{]}\|;:,<.>/?\'\""
+	zle backward-argument
+	zle kill-word
+}
+
+zle -N backward-argument
+zle -N forward-argument
+zle -N kill-argument
+bindkey '\e^b' backward-argument
+bindkey '\e^f' forward-argument
+bindkey '\e^k' kill-argument
+
 zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' '+m:{A-Z}={a-z}'
 zstyle ':completion:*' completer _expand _complete _match