Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 4d28637c4bcd032f1c00003d

Reformat long lines

Rearrange this ruby method call to put each parameter on its own line. Could become a useful macro.

Start file
def default_i18n_subject
  mailer_scope = self.class.mailer_name.gsub('/', '.')
  I18n.t(:subject, :scope => [mailer_scope, action_name], :default => action_name.humanize)
end
End file
def default_i18n_subject
  mailer_scope = self.class.mailer_name.gsub('/', '.')
  I18n.t(:subject,
         :scope => [mailer_scope, action_name],
         :default => action_name.humanize)
end

View Diff

3c3,5
<   I18n.t(:subject, :scope => [mailer_scope, action_name], :default => action_name.humanize)
---
>   I18n.t(:subject,
>          :scope => [mailer_scope, action_name],
>          :default => action_name.humanize)

Solutions by @shahanavazm:

Unlock 7 remaining solutions by signing in and submitting your own entry
Created by: @sermoa

134 active golfers, 358 entries

Solutions by @shahanavazm:
17
#67 - shahanavaz m / @shahanavazm

02/19/2022 at 05:45AM

17
#>67 - shahanavaz m / @shahanavazm

02/01/2024 at 03:05PM

17
#>67 - shahanavaz m / @shahanavazm

03/08/2024 at 05:02AM

18
#>76 - shahanavaz m / @shahanavazm

02/19/2022 at 05:37AM

18
#>76 - shahanavaz m / @shahanavazm

02/01/2024 at 03:03PM

20
#>84 - shahanavaz m / @shahanavazm

02/01/2024 at 03:00PM

22
#>114 - shahanavaz m / @shahanavazm

02/01/2024 at 02:58PM