VIM mode :set paste

:set paste is one of those tiny Vim commands that solves a huge headache. Since you’ve been wrestling with copying from Windows into Vim, this is exactly the right tool.

Here’s the clean, practical breakdown.

🧵 What :set paste actually does

It tells Vim:

  • Do NOT auto-indent
  • Do NOT auto-format
  • Do NOT rewrap text
  • Do NOT insert weird characters when pasting

This prevents the classic “pasted text turns into a mess” problem.

🛠 How to use it correctly

1. Before pasting

In normal mode:

type:

:set paste

Then enter insert mode:

type:

i

Now paste using your terminal shortcut (e.g., Ctrl+Shift+V, right‑click → Paste, etc.).

⚡ Faster method: toggle paste mode

If you want a quick toggle key:

Add this to your ~/.vimrc:

type:

set pastetoggle=<F2>

Now pressing F2 instantly switches paste mode on/off.

vim with clipboard support

When you copy sth from vim editor and want to past it to other application, you would have to install the full build of vim to have clipboard support

In a terminal (not inside vim), run:

You’ll see either:

  • +clipboard is supported ✅
  • -clipboard is not supported ❌
    If you see -clipboard , you are in minimal vim so you would have to install a full build to have clipboard support:

Test if copy inside vim will be able to be pasted outside vim (+clipboard is working), please do:

Inside vim, do this:

  1. Press Esc (to be sure you’re in normal mode)
  2. Move to the start of what you want to copy
  3. Press v→ start selection
  4. Move with arrows / to highlight text
  5. Then press the keys in this exact sequence:

You should not see “+y typed on the screen—vim interprets it as a command, not text.

Now go outside vim and right click → paste