Search code examples
vim

How do I cancel a paste operation in Vim?


I had rather a lot of text on my clipboard whenever I accidentally right clicked inside Putty (with Vim open), and Vim has initiated a paste operation which has been going for around ten minutes now.

I don't want to lose my unsaved work, is there a way to instruct Vim to stop pasting text?


Solution

  • If you're in normal mode, Ctrl-C aborts the current command in progress. Then press u to undo anything that changed before you stopped it.