At some point, the maintainers of vim (an enhanced version of vi, a basic editor in most *nix based machines) decided that it would be a good idea to have a visual mode which changes the interaction with vim when there is a mouse selection. This made copy+pasting horrible, but the solution is super simple.

  1. Create the file ~/.vimrc
  2. Insert in it set mouse-=a

In one line:

echo "set mouse-=a" >> ~/.vimrc

Thanks to this gist for the solution!