Answers:
一种选择是您可以具有确认标志c。
:%s;regex;replacement;gc
:h s_flags:
[c] Confirm each substitution. Vim highlights the matching string. You can type:
'y' to substitute this match
'l' to substitute this match and then quit ("last")
'n' to skip this match
<Esc> to quit substituting
'a' to substitute this and all remaining matches
'q' to quit substituting
您也可以尝试使用grep命令查看过滤的输出和突出显示的原始文件。
:g/re/p 要么 :g/re/
好吧,查看正则表达式将匹配的简短方法是/使用所需的正则表达式进行搜索。它将跳至第一个匹配项并在您键入时将其标记出来。试试吧- vim不会令您失望。