Ken*_*ent 11
例如,你做了一个
/foo
Run Code Online (Sandbox Code Playgroud)
然后你可以:
%s//bar/g
Run Code Online (Sandbox Code Playgroud)
vim将替换所有foo(您的上次搜索)bar
您的上一个搜索模式存储在/寄存器中,您可以通过读取寄存器值来获取它.例如
"/p (in normal mode)
Run Code Online (Sandbox Code Playgroud)
要么
<c-r>/ (in insert/command mode)
Run Code Online (Sandbox Code Playgroud)