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 124 remaining solutions by signing in and submitting your own entry
#125 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

125 active golfers, 320 entries

Leaderboard (lowest score wins):
24
#121 - Ben Friedland / @bfriedland174

05/21/2012 at 07:33AM

25
#122 - conor / @omgconor

02/28/2011 at 11:47PM

25
#123 - Gurukandhamoorthi / @Gurukandhamoor1

08/22/2017 at 03:52PM

26
#124 - vg / @vg53210350

10/29/2018 at 04:13AM

27
#125 - RockerZZY / @rocker_zzy

07/02/2020 at 01:16PM