See Vim tip #1266:

http://www.vim.org/tips/tip.php?tip_id=1266

Note that Vim isn't replaced 'wrong' \r with 'correct' \r.  It is
replacing it with a linebreak, which is then interpreted as  a \n for
unix and a \r\n for dos by the   s///  command.  It is just one of
many odd cases.


On 6/27/06, Kai Weber <[EMAIL PROTECTED]> wrote:
* Michael Naumann <[EMAIL PROTECTED]>:

>> I'm curious though - is there any way to substitute CR with LF using
>> regexp's?
>
> Yes there is, strange as it may seem:
>
> s/\r/\r/
>
> does it

Can somebody enlighten me why this works? Does vim replace "wrong" \r
with corrent \r?

Kai
--
* http://www.glorybox.de/
  PGP 1024D/594D4132 B693 5073 013F 7F56 5DCC  D9C2 E6B5 448C 594D 4132

Reply via email to