/kb

personal knowledgebase

Archive for November, 2008

Remove Windows line endings in VIM

with 5 comments

The Windows line endings (^M) can be easily removed with most editors. In ViM it is very easy.

To remove all windows line endings (and replace with nothing), type the following:

:%s/^V^M//g

(note that the ^V will not display).

Sometimes it is necessary to add a line break as well:

:%s/^V^M/\r/g

Partly based on a Tech Recipes article.

Written by HÃ¥vard Grimelid

November 17th, 2008 at 11:14 am

Posted in Editors

Tagged with , , , ,