In Vim, the canonical methods to interact with X11's Clipboard and Primary is to use +
and *
registers.
There are at least another two ways to paste from Primary into Vim: Shift-Insert and Mouse Middle-Click, which have nearly the same effect of "*p
. Their advantage is that they should work even if Vim has no clipboard support (-clipboard
).
However, since those are handled by the terminal emulator rather than Vim, if the selected text happens to be too large or comes from a cranky PDF, the paste can be really slow and there is no clean way to abort it.
Edit: There are also security concerns when pasting malicious but apparently innocuous data directly into the terminal.
Hence comes the question: Can Vim be made to refuse text pasted from Shift-Insert? I would not like to unbind it from my terminal, XTerm, because it is the only way to paste text into XTerm.
I do not care much to disable Mouse Middle-Click because, after all, it's the mouse and I'm not touching it as long as I have the keyboard. But if there is a solution to both, I will much glad to disable both.
:set paste
or use your pastetoggle before one of those methods—that usually helps speed up a slow paste (treating the input as a paste instead of as characters typed one at a time)Shift
+Insert
, it merely sees some input, but it doesn't know whether you typed it or it was pasted, because this is some interprocess communication from your X11 session. If at all, you would need to configure your X11 session to ignore theShift-Insert
key combination. Don't think this is actually possible.