From d373f6e27091bde2553466a83766fc096982be9e Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Thu, 14 Jul 2016 10:49:36 +0200 Subject: zsh: Add argument-wise word commands --- tag-zsh/config/zsh/zshrc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'tag-zsh/config/zsh/zshrc') diff --git a/tag-zsh/config/zsh/zshrc b/tag-zsh/config/zsh/zshrc index 9a85643d..6e034e9e 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 -- cgit 1.4.1