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 132 remaining solutions by signing in and submitting your own entry
#133 Justin Choi / @Mcthecuber - Score: 50 - 07/01/24 @ 22:01
:%s/, :/,]\<BS>\r<BS><BS><BS>\r:/g<CR>i         <Esc>kI          <BS><Esc>ZZ

0 comments


Created by: @sermoa

133 active golfers, 346 entries

Leaderboard (lowest score wins):
17
#61 - Jim Infield / @jinfield

07/19/2011 at 03:40PM

17
#62 - Ben Somers / @somanyrobots

11/30/2011 at 01:39AM

17
#63 - Xavier Nayrac / @lkdjiin

01/07/2012 at 09:06PM

17
#64 - Vasil Sakarov / @vsakarov

01/15/2012 at 08:50PM

17
#65 - deroguerre / @DeroguerreGui

06/05/2013 at 12:56PM

17
#66 - shahanavaz m / @shahanavazm

02/19/2022 at 05:45AM

18
#67 - Israel Chauca F. / @Raimondi

01/08/2011 at 02:50PM

18
#68 - Benoît Ryder / @benoitryder

01/11/2011 at 08:53PM

18
#69 - drio / @drio

01/18/2011 at 12:14AM

18
#70 - Kevin Hamer / @khamer

01/19/2011 at 11:01PM

18
#71 - thorir danielsson / @thorird

01/23/2011 at 11:03PM

18
#72 - Franco Lazzarino / @flazz

01/29/2011 at 02:05AM

18
#73 - Tom Duijf / @tomduijf

02/12/2011 at 04:39PM

18
#74 - Dave / @zzdave13

07/24/2011 at 09:50PM

18
#75 - Ram Tamtam / @ramtamtamtam

07/03/2014 at 07:46AM

18
#76 - bonettimrc / @bonettimrc

04/28/2024 at 01:49PM

19
#77 - Paul King / @nrocy

01/08/2011 at 05:11PM

19
#78 - t_lini / @t_lini

01/09/2011 at 11:51PM

19
#79 -  Ikhsan Maulana / @ixandidu

01/14/2011 at 05:12PM

19
#80 - Aaron Kalin / @martinisoft

03/01/2011 at 01:35AM

20
#81 - Daumantas / @dbaltrus

05/04/2012 at 02:33PM

20
#82 - cj / @cj01101

10/21/2013 at 10:45PM

20
#83 - ひげまにや / @higemaniya

01/29/2014 at 03:14AM

21
#84 - Mattiassich Ákos / @mattiassicha

01/08/2011 at 02:06PM

21
#85 - Josh Weinberg / @jcweinberg

01/08/2011 at 04:35PM

21
#86 - Akira Matsuda / @a_matsuda

01/08/2011 at 05:41PM

21
#87 - aaaa3331 / @aaaa3331

01/08/2011 at 11:01PM

21
#88 - alexscott / @4l3xsc0tt

01/10/2011 at 01:49AM

21
#89 - Agus Lopez / @aguslr

01/10/2011 at 08:54PM

21
#90 - Thomas Schönwälder / @Masei1988

01/11/2011 at 11:02PM