Kill/Yank (cut/paste) in ZSH
I use zsh and have the Emacs keybindings set up for it. I'd love to have it replicate all my regular Emacs text manipulation commands. One which I miss is the Kill/Yank keys. It would be nice if I could select text (using C-SPC - 开发者_如何学编程this works) and then do something like a kill-region
(C-w - This right now deletes the previous word). The yank (C-y) works fine and I can even even cycle through them using M-y.
Does anyone have such a setup working?
A simple "\C-w": kill-region
in my .inputrc
file binds the key to the function I want.
Update: Spoke too soon. The above only does it for applications that use the readline libraries. Zsh uses its own zle
. The way to configure similar behaviour is to stick bindkey "\C-w" kill-region
into your .zshrc
精彩评论