I\'d like to exchange the currently selected text in eclipse (or even any program) on linux with the content of the clipboard when pressing a shortcut like Ctrl-B. Any ideas
With xclip
, these three steps can be performed (read >
as "replaces"):
Since no program ever uses it, we use Secondary as a temporary slot to swap Clipboard with Primary.
xclip -o -sel p|xclip -i -sel s
xclip -o -sel c|xclip -i -sel p
xclip -o -sel s|xclip -i -sel c
Make the script executable with chmod +x script
and now you can bind a shortcut to it.