Search and Replace Control Characters In Vim
In vim, if you want to search and replace non-printable control characters (for example you have ^M scattered throughout your file and it's messing up an import) you can use ctrl+v+<char>. The ctrl+v allows you to type the control character, but you must hold down control for both of the key presses.
:%s/ctrl+v+M/
This would search and replace all non-printable ^M characters in your text.