x
doesn't put things on the clipboard, it puts them into a register. If you don't tell it which register to put it into, it puts it into the unnamed register, which of course overwrites the previous contents. So, instead, tell it which register to use: " REGISTER x
, where REGISTER is any single letter. You then use the same quote-register prefix to p to paste from that register. (Note: lowercase replaces their content; uppercase appends).
There are also two special registers "0
and "1
. "0
is the most recently yanked (y) text, which will remain even if you delete some text with another command (like x). "1
is the most-recently deleted text, as long as that text isn't small (one line). Small deleted text goes in "-
.
Finally, as Steve Vermeulen points out, you can tell vim not to save deleted text by specifying the black hole register "_
.
The relevant help command is :help registers
.