Technical
Clear Windows Littering

How to remove ^M from you source code.

Yes, heterogeneous leaves its trace.

To remove all the annoying ^M characters left by your fellow developer who has chosen developing on windows do the following.

Either read here or continue reading.

BE SURE YOU MAKE the ^M USING “CTRL-V CTRL-M” NOT BY TYPING “CARROT M”!

To replace all extraneous ^M:


:%s/^M$//g 

To replace all ^M’s that need to have carriage returns:


:%s/^M/ /g