I have noticed that zsh has a lot of things I see in emacs. I can make a selection with ctrl+space and selecting a region. I can make copies just like in emacs while I stay inside zsh. In emacs I'm able to use my system clipboard (previously with some additional configuration needed but this works out of the box now in emacs). In zsh I can't seem to paste from my clipboard using C-y and copying from zsh to my system cliipboard has the same issue. Is there a way around this?
Zsh copy and paste like emacs
clipboardzsh
Best Answer
Zsh's has a built-in clipboard that doesn't communicate with other applications. Since it's very scriptable, you can make it communicate with a few lines in your
~/.zshrc
. You'll need xclip or xsel. See Pasting from clipboard to vi-enabled zsh or bash shell for a proof-of-concept in vi mode. Here's the corresponding code for emacs mode (you'll probably want to do something similar to otherkill-*
widgets).This uses the X11 clipboard (typically accessed with Ctrl+C/Ctrl+V); remove the
-b
option to use the X11 primary selection instead (automatic copy on select, and paste with the middle mouse button).