0

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

Jeff Schaller
  • 66,199
  • 35
  • 114
  • 250
Michael Durrant
  • 41,213
  • 69
  • 165
  • 232

1 Answers1

7

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.

Michael Durrant
  • 41,213
  • 69
  • 165
  • 232