Occasionally, I paste large amounts of data into vim, using Ctrl+v in my terminal emulator (in Linux). This takes several seconds before vim is responsive again. I have tried two other methods, which work well: either "+P
, or temporarily :set noswapfile
before pasting.
I have tested launching vanilla vim, using vim -u NONE
, and the problem still persists. As a reference, this 5600-character lorem ipsum takes ~3 seconds to paste with Ctrl+v. It's almost instantaneous with "+P
.
I only need the paste alternatives with large data and vim. In all other situations I use Ctrl+v. In vim, this also has the added advantage of working in insert mode. It's only after I paste long data, when I regret my life choices.
Is there a way to automatically apply some workaround, so that is it consistently quick to paste with Ctrl+v?
pbpaste >> file
or equivalent. You might get away with:read !pbpaste
but honestly I expect a performance hit with that much input` – D. Ben Knoble♦ Jan 27 '19 at 6:13:set swapsync=
? That should prevent Vim from waiting until the swapfile is completly written. – Christian Brabandt Jan 28 '19 at 12:55"+
vim knows that the input is coming from the system clipboard while for your other method of pasting it seems vim doesn't know. So it has to process the input as typed. – Christian Brabandt May 7 '19 at 5:46xterm-bracketed-paste
you haven't said what terminal you used andxterm-bracketed-pasted
needs terminal support. So my guess is, it is not being used (or not correctly configured), don't know – Christian Brabandt May 7 '19 at 10:13