Vim: Convert ^M to linebreaks

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
peter_b
Chatterbox
Posts: 383
Joined: Tue Nov 12, 2013 2:05 am

Vim: Convert ^M to linebreaks

Post by peter_b »

In case you see "^M" characters where linebreaks should be, and "set fileformat=dos" doesn't work - neither does "dos2unix", here's a trick:

Code: Select all

:%s/\r/\r/g
Source:
gVim showing carriage return (^M) even when file mode is explicitly DOS
Post Reply