Vim and ^M Dos characters > Post > Dec 04, 2009 01 p.m.
I've been working on a Flex project recently, one that I used to compile in Windows, but have since moved over to Linux with the Flex SDK. One of the problems I run into is that Dos appears to leave these characters in my files at the end of each line
// a comment in my flex file^M
The solution
It's painful to have to delete them all manually, so a simple command in vim will do it:
:1,$ s/^M//
To get the ^M you can hit 'Ctrl+v' and then 'Enter'
Aaron