If you paste text in vim and sometimes it distorts the text like some extra indentation gets added. This is a pain for those who work with python 😛
This problem occurs when there is auto indent or smart indent enabled. There might be other reasons.
To solve this simply type in command mode:
this will put vim in paste mode. And try pasting the same text now. It works.
To disable the paste mode, type:
You may also try :set noai and :set nosi for disabling autoindent and smartindent respectively. When you are done pasting, do :set ai and :set si