Page 1 of 1

Vim: Convert ^M to linebreaks

Posted: Tue Oct 24, 2017 8:49 pm
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