When editing a dos-format file from a codebase which is mainly used with Visual Studio in a Windows environment on my local Ubuntu machine with VIM, I get to see the ^M character instead of a newline.
According to the VIM documentation, this represents the carriage return character.
Further complicating the problem is that this only occurs in certain places in the file, so the newlines don't seem to have a consistent format.
By default, VIM recognizes the file as dos file-format, which I see by executing :set ff?
.
My goal is to edit the file without breaking its platform conformity; I don't want to persistently convert the file, only because I'm editing in VIM. Hence, the existing answer doesn't satisfy my problem. This answer, doesn't either.
Given this requirement, can I get VIM to just display all ^M's as newlines via some syntax highlighting setting?
Note that ^M isn't composed out of plain characters. I you'd insert them manually in VIM, you'd have to insert Cntr-V before inserting each character.