Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

This question already has an answer here:

I can copy characters in other apps such as browsers with ctrlc.

I can then press i to enter insert mode in vim and press shiftctrlv to paste the text in.

The problem is that each line gets indented a bit more so I end up with:

enter image description here

but what I want (and end up manually editing to achieve) is:enter image description here

share|improve this question

marked as duplicate by Patrick, vonbrand, Renan, jasonwryan, Gilles May 11 '13 at 22:36

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 3 down vote accepted

Using :set paste prevents vim from re-tabbing my code and fixes the problem.
Also, :set nopaste turns it off

I also put set pastetoggle=<F2>in my .vimrc so I can toggle it with the F2 key.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.