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 @nickandbro:

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

134 active golfers, 358 entries

Solutions by @nickandbro:
15
#31 - nickGPT / @nickandbro

08/28/2024 at 11:18PM

16
#>38 - nickGPT / @nickandbro

08/28/2024 at 11:18PM

17
#>67 - nickGPT / @nickandbro

08/28/2024 at 11:18PM

18
#>77 - nickGPT / @nickandbro

08/28/2024 at 11:18PM

19
#>81 - nickGPT / @nickandbro

08/28/2024 at 11:18PM

20
#>84 - nickGPT / @nickandbro

08/28/2024 at 11:18PM

21
#>107 - nickGPT / @nickandbro

08/28/2024 at 11:17PM

24
#>129 - nickGPT / @nickandbro

08/28/2024 at 11:17PM

25
#>131 - nickGPT / @nickandbro

08/28/2024 at 11:17PM

26
#>132 - nickGPT / @nickandbro

08/28/2024 at 11:17PM

27
#>133 - nickGPT / @nickandbro

08/28/2024 at 11:17PM

50
#>134 - nickGPT / @nickandbro

08/28/2024 at 11:17PM