How to make vi-mode bindings in terminal copy to clipboard
+2
−0
If I want to yank my last command I can UP
yy
, but this does not
copy to the system clipboard.
How do I configure my terminal to copy to the system clipboard so I can paste into other programs?
I am using zsh, but an answer for bash and zsh would be thorough and appreciated.
1 answer
+1
−0
I don't know if this is universal or specific to my setup (zsh, GNOME Terminal, Xorg), but using "+yy
(double quote, plus, Y, Y) instead of just yy
works for me.
Note this is the same command used within Vim itself to copy to the main clipboard instead of a Vim-internal register, so it makes sense for this to work in ZSH as well.
2 comment threads