all repos — nixfiles @ d373f6e27091bde2553466a83766fc096982be9e

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

zsh: Add argument-wise word commands
Alan Pearce alan.pearce@spotcap.com
Thu, 14 Jul 2016 10:49:36 +0200
commit

d373f6e27091bde2553466a83766fc096982be9e

parent

b6464ffdea4578828c9abdf3b3d2dd2799676f85

1 files changed, 23 insertions(+), 0 deletions(-)

jump to
M tag-zsh/config/zsh/zshrctag-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