我有一个fileformat=dos
的文件,其中vim将所有换行符显示为^M
。但是,当我尝试通过使用
^M
\r
来解决此问题时
:%s/<Ctrl-V><Ctrl-M>/\r/g
然后命令不是全局执行,而是在替换第一个^M
字符后停止?
答案 0 :(得分:3)
I found the answer thanks to Micheal's comment:
Are the gdefault or edcompatible options off? Read :help s_flags.
After setting :set nogdefault
the substitution is now global.