Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change ^M to new line in vim? [duplicate]

Tags:

regex

vim

Possible Duplicate:
How to edit a file in Vim with all lines ending in ^M except the last line ending in ^M^J

i have html file .. one line file .. Has been replaced new line to ^M

But it works well with notepad++

How i can Reformed in vim ?

thanks

like image 515
Tarek Saied Avatar asked Jan 12 '11 06:01

Tarek Saied


1 Answers

:e ++ff=mac

^J = <LF> = \n
^M = <CR> = \r

If the only line separators in your file are \r, it uses Mac-style line endings.

like image 62
ephemient Avatar answered Oct 22 '22 05:10

ephemient