\n表示行尾,是一个位置。\r表示回车,是一个字符。 因此,查找时应当使用\n,替换时应当使用\r。如果替换时使用\n,将插入一个NUL字符,会显示为^@。 参考: How to replace a character by a newline in Vim?