开发者

Kill/Yank (cut/paste) in ZSH

开发者 https://www.devze.com 2022-12-18 04:50 出处:网络
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 co

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号