Vim is adding lots of spaces and newlines when copy / pasting. This is what it looks like:
How do I fix this?
Gedit is using 4 spaces per indent, your VIM looks like it's using 8 spaces per indent.
There's nothing wrong, just a simple setting difference.
Look up the options:
:set sw=4 sts=4 ts=8 et
will make your VIM look like your Gedit.
you probably have vim's autoindent mode on. try turning it off with
also, as mentioned by CR above,
:set paste greatly improves vim's behaviour while pasting text into it...with paste mode set you don't need to mess around manually setting text-width, wrap-margin or anything else likely to mess up long lines or text spacing. remember to use
:set nopaste when you've finished pasting.
I assume you're pasting from the clipboard or something? Try
:set paste before pasting.
The first thing I do on any new machine is put
set paste in my vimrc. I prefer paste mode as the default behaviour.
And you can use
:set nopaste to turn paste mode off and the auto-format back on.