Your Site Title

回车与换行

在vim中, \n是匹配行结束, \r是匹配回车符. 插入中, \n是插入null字符(^@), \r是插入 回车CR. 所以要把字符替换成换行, 需要%s/a/\r/g

打开特殊字段匹配(可以匹配^@之类), :set magic

Reference

How to replace a character by a newline in Vim
What is the difference between \r\n, \r, and \n? [duplicate]