How do I paste from PuTTY into Vim 8.0?

How do I paste from PuTTY into Vim 8.0?

Well, nice question, as I found it quite annoying that the usual right click on the mouse doesn’t work. In fact


Open a web browser, copy / paste some text from a website (eg. GitHub)
Use PuTTY 0.67 to SSH to a Linux VM (eg. Ubuntu 16 Xenial Xerus)
Open a file in Vim
Hit i to change into Insert mode
Right-click to paste the clipboard contents
Issue
Unfortunately, when I right-click in the PuTTY session, rather than pasting clipboard contents, what’s actually happening is that Vim is going from INSERT mode to (insert) VISUAL mode. I don’t think I’ve ever seen anything like this before.

Luckly it seems that there’s an easy workaround.


Adapt to it: With mouse mode turned on, the new way to paste is shift-right-click (at least in PuTTY)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.