I think you know what I’m talking about: you copy and paste something in Vim, and if there is a comment, all the following lines become commented.
How to avoid this behaviour? Use this command under vim
:set formatoptions-=cro
If you are in insert mode in Vim, you need to press ESC before entering this command.
Another solution should be:
:set paste (disable auto-indentation)
(paste what you have copied)
:set nopaste (enable auto-indentation)