vim 删除文件后的^m
When editing some files fro Windows in vim, there are some ugly “^M” returns. Here is a method to remove and replace these “^M”s (please note that you should not copy/past to use the follows):
在vim中通过Windows编辑某些文件时 ,会有一些难看的“ ^ M”返回。 这是删除和替换这些“ ^ M”的方法(请注意,您不应复制/粘贴以下内容):
:1,$s/{Ctrl+V}{Ctrl+M}//{Enter}
{Ctrl+V} means keyboard operation that is push ‘ctrl’ and ‘v’ together. {Enter} is push ‘enter’.
{Ctrl + V}表示将“ ctrl”和“ v”同时按下的键盘操作。 {Enter}是按“ enter”键。
: means that it is a ex command.
:表示这是一个ex 命令 。
1,$ means that the line number range is from the first line to the last line.
1,$表示行号范围是从第一行到最后一行。
{Ctrl+V}{Ctrl+M} is the “^M”. {Ctrl+V} tells the vim to treat the next character as regular character.
{Ctrl + V} {Ctrl + M}是“ ^ M”。 {Ctrl + V}告诉vim将下一个字符视为常规字符。
翻译自: https://www.systutorials.com/vim-remove-m-returns-from-files/
vim 删除文件后的^m