1

我想快速重构当前行例如:

Subscription.create(:user => @user, :app => this_app, :verified => true, :approved => true)

Subscription.create(user: @user,app: this_app, verified: true, approved: true)

我只想在光标下方的行或选定的代码中更改该语法。

4

1 回答 1

2

这将起作用

:%s/:\([^ ]*\)\(\s*\)=>/\1:/g

从那篇博文中偷来的

请注意,您也可以使用该 gem

于 2012-11-01T16:48:23.393 回答