怎么去除windows编辑过的文件中的^M字符

We can use the following two methods to get rid of the “^M” character in a file which was edited on windows using vim.

1.

1
:%s/\r//g

2.

1
:%s/ctrl-v ctrl-m//g

The second one means pressing ctrl-v, then ctrl-m first.