How to Paste in Vim?

Press `i` to enter Insert mode, then use your terminal’s paste shortcut

Press `Esc`, then `p` to paste after the cursor

Press `Esc`, then `P` to paste before the cursor

Use `”+p` to paste from the system clipboard after the cursor

Use `”+P` to paste from the system clipboard before the cursor

Use `”*p` to paste from the primary selection after the cursor

Use `”*P` to paste from the primary selection before the cursor

In Visual mode, select text, then press `p` to replace it with the pasted text

If autoindent causes issues, use `:set paste` before pasting

Turn paste mode off with `:set nopaste` after pasting

Suggested for You

Trending Today