这是我的情况我有很多sql行,如下所示.
SET IDENTITY_INSERT blah DELETE FROM blah SET IDENTITY_INSERT blah DELETE FROM blah SET IDENTITY_INSERT blah DELETE FROM blah SET IDENTITY_INSERT blah DELETE FROM blah SET IDENTITY_INSERT blah DELETE FROM blah
我想用VIM重新排列它
SET IDENTITY_INSERT blah SET IDENTITY_INSERT blah SET IDENTITY_INSERT blah SET IDENTITY_INSERT blah DELETE FROM blah DELETE FROM blah DELETE FROM blah
现在我知道我可以写一个简单的python脚本来快速完成这个,但我正在努力提高我的VIM技能.
你可以使用g命令:
原文链接:https://www.f2er.com/bash/383405.html:g/^DELETE/m$
这会将(m)以DELETE开头的所有行移动到文件末尾($).