标签: vim
:keep sometext(自定义VIM命令) - > :%g!/sometext/d(现有语法)
:keep sometext
:%g!/sometext/d
如何在VIM中实现上述转换?
:keep hello - > %g!/hello/d(例如)
:keep hello
%g!/hello/d
答案 0 :(得分:1)
尝试使用此cmd:
command! -buffer -nargs=1 Keep v/<args>/d
然后你可以:Keep pattern
:Keep pattern
:h command了解详情。
:h command