26Apr 2006 How do I remove control characters from a file? by troyski ⋅ Leave a Comment Such as ^M seen when files are incorrectly transferred between platforms. :%s/[Ctrl-v][Ctrl-m]//g:%s/[Ctrl-v][Ctrl-m]//g i.e. [Ctrl-v] mean press the Ctrl key and v together. The second control character (^M) is the one we want to remove.