Before you paste, type this in normal mode:
:set paste
Then enter insert mode. You will see the status bar say insert (paste). Paste your code. Hit ESC to return to normal mode, and:
:set nopaste
You are no longer in paste mode.
Before you paste, type this in normal mode:
:set paste
Then enter insert mode. You will see the status bar say insert (paste). Paste your code. Hit ESC to return to normal mode, and:
:set nopaste
You are no longer in paste mode.