zsh: Add argument-wise word commands
Alan Pearce alan.pearce@spotcap.com
Thu, 14 Jul 2016 10:49:36 +0200
1 files changed, 23 insertions(+), 0 deletions(-)
jump to
M tag-zsh/config/zsh/zshrc → 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