这是我的情况我有很多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命令:
:g/^DELETE/m$
这会将(m)以DELETE开头的所有行移动到文件末尾($).