这对你有用吗?
:'<,'>s/></>\r</g
你正在使用Windows并尝试同时插入(literal) \r
(回车)和\n
(换行)吗?
我刚刚成功地将星号移到了新行的开头(即用换行符+星号替换星号字符),方法如下:
:%s/\*/\r*/g
:%s (replace in whole file)
\* (literal asterisk)
\r* (new line followed by literal asterisk)
g (operate on all matches on any given line)
\r
。请参考https://dev59.com/iXVD5IYBdhLWcg3wJIEK - Wiktor Stribiżew