我需要删除两个模式之间的所有内容,或者更确切地说,剪切它并将其注册以供以后使用(将其放入不同的文件中)
%s/\V<se.\{-}<\/sel//gc
Run Code Online (Sandbox Code Playgroud)
但这只是删除(它不起作用,我想剪切它并将其注册(也许我需要一些脚本)
使用全局命令就可以了。
let @a=''|g/startpattern/.+1,/stoppattern/-1 delete A
Run Code Online (Sandbox Code Playgroud)
在哪里
let @a='' - Clear the a register
g/startpattern/ - search for the start of the pattern
.+1,/stoppattern/-1 delete A - delete everything between start and stop and
append it to register a
Run Code Online (Sandbox Code Playgroud)
效劳于
startpattern
this goes to register A
so does this
stoppattern
Run Code Online (Sandbox Code Playgroud)
但不是为了
startpattern this should go to register A stoppattern.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1820 次 |
| 最近记录: |