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):
21
#91 - Dezső Zoltán / @zakiazigazi

01/22/2011 at 10:33AM

21
#92 - Tact Overflow / @muppling

02/07/2011 at 07:51PM

21
#93 - Nomen Nescio / @vadtusan

04/13/2011 at 10:04PM

21
#94 - Piotr Ślatała / @pslapsla

04/25/2011 at 03:13PM

21
#95 - Pan Thomakos / @panthomakos

04/27/2011 at 03:42PM

21
#96 - Lauri Tirkkonen / @lotheac

07/01/2011 at 08:37PM

21
#97 - William Dunand / @wdunand

11/15/2011 at 08:45AM

21
#98 - Christopher Brew / @Seph1rothVII

01/12/2012 at 01:01AM

21
#99 - Ashley Feniello / @AshleyFen

01/29/2012 at 07:27AM

21
#100 - James Freed / @JamesTFreed

02/03/2012 at 01:16AM

21
#101 - JonLz / @LzJon

12/26/2012 at 07:35PM

21
#102 - zmf_tim / @zmf_tim

07/25/2013 at 01:18PM

21
#103 - Sylvain Dangin / @Sylvaner03

02/24/2021 at 08:43PM

22
#104 - Shrikant Sharat / @sharat87

01/08/2011 at 01:55PM

22
#105 - Victor Vaile / @victorv4_

01/08/2011 at 11:54PM

22
#106 - Nico / @nicou

01/20/2011 at 11:58PM

22
#107 - bestform / @bestform

02/06/2011 at 03:02PM

22
#108 - Cameron Fowler / @camfowler

02/13/2013 at 04:33AM

22
#109 - pikaren / @REALpikaren

01/23/2014 at 12:52PM

22
#110 - James / @Dronak

09/18/2014 at 08:41PM

23
#111 - Brian Buckley / @bbuckley

01/08/2011 at 02:48PM

23
#112 - Dj Vimgolf / @dj_vimgolf

12/31/2011 at 02:13PM

23
#113 - 無ん垢の叫び / @john_ababa

02/26/2012 at 08:09AM

23
#114 - Arto Vuori / @dhpe

09/01/2012 at 05:41PM

23
#115 - ltn614 / @ltn614

10/03/2015 at 01:37PM

24
#116 - Clive Evans / @swish_bob

01/08/2011 at 05:08PM

24
#117 - Kylan Robinson / @kylan

01/09/2011 at 04:32PM

24
#118 - Kurinniy Alexander / @kurinniy

01/21/2011 at 02:49PM

24
#119 - Ravil Bayramgalin / @brainopia

02/12/2011 at 06:31PM

24
#120 - Mathias Bynens  / @mathias

04/08/2011 at 08:13AM