How to paste / insert in vim from clipboard

When ever I tried to insert text from the clipboard to vim it did either not work at all or the lines were inserted like a tree, each line more indented.

To fix that, you can do the following:
Before pasting into vim, enable paste mode by entering :set paste.
Press I to enter insert mode. The status bar should say — INSERT (paste) — now.
Press Shift + Insert (The auto indentation of vim should not happen.)
Press Esc to leave insert mode, and disable paste mode using :set nopaste again.
This works from windows terminal, putty, linux terminal and WSL.

One thought on “How to paste / insert in vim from clipboard

Leave a Reply

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