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

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 128 remaining solutions by signing in and submitting your own entry
#129 RockerZZY / @rocker_zzy - Score: 27 - 07/02/20 @ 13:16
2jf ;r<CR>d08i <Esc>f:;hr<CR>d08i <Esc>ZZ

0 comments


Created by: @sermoa

129 active golfers, 329 entries

Leaderboard (lowest score wins):
24
#121 - Bryan Kendall / @bkendall

06/02/2011 at 03:09PM

24
#122 - johan wester / @wester87

11/12/2011 at 07:09PM

24
#123 - Ivo Dancet / @caifara

12/04/2011 at 07:32PM

24
#124 - BlurredWeasel / @BlurredWeasel

02/14/2012 at 05:56AM

24
#125 - Ben Friedland / @bfriedland174

05/21/2012 at 07:33AM

25
#126 - conor / @omgconor

02/28/2011 at 11:47PM

25
#127 - Gurukandhamoorthi / @Gurukandhamoor1

08/22/2017 at 03:52PM

26
#128 - vg / @vg53210350

10/29/2018 at 04:13AM

27
#129 - RockerZZY / @rocker_zzy

07/02/2020 at 01:16PM