Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I select and copy a large block of plain text from some file (e.g. gedit). I run :set paste and then enter insert mode, and paste the text in using the right mouse-button menu. vim them uses 100% cpu for the next several minutes before successfully pasting my text in. The text is usually only a few pages, and takes less than a second to paste into other applications (gedit window, web window, etc). What is vim doing with all those clock cycles and how can I make this more efficient?

share|improve this question
up vote 2 down vote accepted

You should probably file a bug report against vim on this one.

share|improve this answer
okay, thanks. I've posted my bug to as suggested here:, we'll see if anything happens. – cboettig Nov 26 '12 at 5:12

Based on a suggestion from the maintainer after filing a bug report, it seems this problem is caused by the syntax highlighter. Disabling syntax highlighting temporarily (:set syntax=off) fixes this, though having to do both that and :set paste, and then toggle each back again is rather annoying (yes, I know I could map the commands in .vimrc. It is still annoying). Pasting also runs faster in gvim than in vim. Not sure why.

So, current answer is "turn off syntax highlighting"...

share|improve this answer
Why don't you mark this as the correct answer? – ndemou Oct 21 '14 at 20:30
Because I feel that Jim's answer is correct, this is a bug. There's no reason one should need to turn syntax highlighting off for a simple copy-paste to work smoothly like it does in gedit, etc. Just seems that the bug depends on the syntax highlighter extension, not base vim. – cboettig Oct 22 '14 at 3:19
Who is then that cboettig that wrote: So, current answer is "turn off syntax highlighting"... :-). I'm being sarcastic of course but don't get me wrong, I'm just noting the contradiction. Anyway after investigating a bit more I thing that the evilsoup's answer is even more to the point. See also… – ndemou Oct 22 '14 at 6:41

The correct way to paste text in vim is with the p command (from normal mode).

To paste from the xclipboard (the 'middle-click' clipboard), you should use "*p. To paste from the Ctrl+v clipbaord, use "+p.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.