GVim - pattern not found: ^ M when trying to delete a new line

I work with gVim on Windows, and when I open files edited by others, I see ^ M instead of new lines. I tried to use %s/^M/\n/gto replace all instances of ^ M with a new line, but I keep getting the error: pattern not found: ^ M. I also tried %s/^M/\r/g, but get the same error.

There are several more instances of the ^ M file in the file, why can't Vim identify them?

+5
source share
2 answers

Click CTRL Vbefore clicking CTRL Mon your lookup command.

This allows you to avoid the following control sequence.

Here are some links I found on googling vim remove control m:

+7

, carat-M, ctrl-M? carat-M (^ M), . ctrl-M, . , .

0

All Articles