Remove ^M characters at end of lines in vim
^M
To remove the ^M characters at the end of all lines in vim, use:
:%s/^V^M//g
The ^v is a CONTROL-V character and ^m is a CONTROL-M. When you type this, it will look like:
:%s/^M//g