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):
17
#61 - Xavier Nayrac / @lkdjiin

01/07/2012 at 09:06PM

17
#62 - Vasil Sakarov / @vsakarov

01/15/2012 at 08:50PM

17
#63 - deroguerre / @DeroguerreGui

06/05/2013 at 12:56PM

17
#64 - shahanavaz m / @shahanavazm

02/19/2022 at 05:45AM

18
#65 - Israel Chauca F. / @Raimondi

01/08/2011 at 02:50PM

18
#66 - Benoît Ryder / @benoitryder

01/11/2011 at 08:53PM

18
#67 - drio / @drio

01/18/2011 at 12:14AM

18
#68 - Kevin Hamer / @khamer

01/19/2011 at 11:01PM

18
#69 - thorir danielsson / @thorird

01/23/2011 at 11:03PM

18
#70 - Franco Lazzarino / @flazz

01/29/2011 at 02:05AM

18
#71 - Tom Duijf / @tomduijf

02/12/2011 at 04:39PM

18
#72 - Dave / @zzdave13

07/24/2011 at 09:50PM

18
#73 - Ram Tamtam / @ramtamtamtam

07/03/2014 at 07:46AM

19
#74 - Paul King / @nrocy

01/08/2011 at 05:11PM

19
#75 - t_lini / @t_lini

01/09/2011 at 11:51PM

19
#76 -  Ikhsan Maulana / @ixandidu

01/14/2011 at 05:12PM

19
#77 - Aaron Kalin / @martinisoft

03/01/2011 at 01:35AM

20
#78 - Daumantas / @dbaltrus

05/04/2012 at 02:33PM

20
#79 - cj / @cj01101

10/21/2013 at 10:45PM

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

01/29/2014 at 03:14AM

21
#81 - Mattiassich Ákos / @mattiassicha

01/08/2011 at 02:06PM

21
#82 - Josh Weinberg / @jcweinberg

01/08/2011 at 04:35PM

21
#83 - Akira Matsuda / @a_matsuda

01/08/2011 at 05:41PM

21
#84 - aaaa3331 / @aaaa3331

01/08/2011 at 11:01PM

21
#85 - alex scott / @4l3xsc0tt

01/10/2011 at 01:49AM

21
#86 - Agus Lopez / @aguslr

01/10/2011 at 08:54PM

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

01/11/2011 at 11:02PM

21
#88 - Tien Le / @tienlex

01/12/2011 at 02:37PM

21
#89 - Eric Weikl / @ericweikl

01/16/2011 at 09:41PM

21
#90 - Andrey A. Ugolnik / @andreyugolnik

01/19/2011 at 05:11PM