:%s/aaa/bbb/ | %s/111/222/
第一次搜索和替换不会找到任何匹配,第二次搜索和替换将不会执行。命令“失败”,有没有什么办法可以告诉vim继续?
发布于 2018-05-11 20:12:35
尝试
:%s/aaa/bbb/e | %s/111/222/e
并阅读
:help :s_flags
特别是[e]下的条目:
When the search pattern fails, do not issue an error message and, in
particular, continue in maps as if no error occurred. This is most
useful to prevent the "No match" error from breaking a mapping. Vim
does not suppress the following error messages, however:
Regular expressions can't be delimited by letters
\ should be followed by /, ? or &
No previous substitute regular expression
Trailing characters
Interrupted
https://stackoverflow.com/questions/-100003339
复制相似问题