I know how to remove ^M
in my files (%s/^M//g
), but this one is just one line I\'d like to replace ^M
with enter... what\'s the enter char
:%s/\r//g
only works when:
set ff=unix
, which when done, automatically converts all CRLF
to LF
set ff=dos
and CR
is a rogue char that is not preceded by LF, e.g., inserted with C-V C-M
.
CR in LF CR pairs will not be found.
Therefore, if all you want is to convert every LF CR
to LF
, you should use:
:set ff=unix
:w