phup 'n stuff

Another Blog About Being a Developer

Posts Tagged ‘Vim’

Removing Windows Newline Characters in Vim

Monday, December 21st, 2009

Sometimes when working on projects in both Linux and Windows, a file will end up with Windows newline characters, which show up as ^M in Vim. Annoying as this is, there's a quick fix to remove them in Vim using a regular expression replace:

:%s/<control-v><control-m>//g

Magically, all the ugly Windows newline characters are gone.