vim shows on every line ending ^M
How I do to replace this with a 'normal' linebreak?
vim shows on every line ending ^M
How I do to replace this with a 'normal' linebreak?
On Linux and Mac OS, the following works
:%s/^V^M/^V^M/g
(where ^V means control-V and ^M means control-M)
Try this:
:%s/<Ctrl-V><Ctrl-M>//g
which means
:%s
substitute
<Ctrl-V><Ctrl-M>
^M characters (the Ctrl-V is a Vim way of writing the Ctrl ^ character)
//
with "" (NULL) characters (the character between the 2 forward-slash / characters)
g
And do it globally (not just the first occurrence on the line).
Look at the file type - DOS or Unix:
:set filetype=unix
The file will be written back without carriage return (CR, ^M) characters.
Alternatively, there are open-source utilities called dos2unix and unix2dos available that do this very thing. On a linux system they are probably installed by default; for a windows system you can download them from http://www.bastet.com/ amongst others.