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):
16
#31 - Sebastian Korten / @FlashKorten

07/21/2012 at 02:54PM

16
#32 - churaki / @churaki

02/06/2019 at 09:03AM

17
#33 - h_east (トロッコ6個) / @h_east

01/08/2011 at 01:45PM

17
#34 - Matthew Draper / @_matthewd

01/08/2011 at 01:48PM

17
#35 - Henrik Nyh / @henrik

01/08/2011 at 01:49PM

17
#36 - Ujjwol Lamichhane / @Ujjwol

01/08/2011 at 02:33PM

17
#37 - Tim Chase / @gumnos

01/08/2011 at 03:08PM

17
#38 - Balkoth / @_Balkoth_

01/08/2011 at 03:39PM

17
#39 - Douglas Stockwell / @dstockwell

01/08/2011 at 06:01PM

17
#40 - Pete Johns / @johnsyweb

01/08/2011 at 08:57PM

17
#41 - Soliman Sylvain / @sylvain_soliman

01/08/2011 at 10:09PM

17
#42 - AD / @golferTest101

01/08/2011 at 10:14PM

17
#43 - Utkarsh Kukreti / @utkarshkukreti

01/09/2011 at 12:13AM

17
#44 - Francisco Dibar / @frandibar

01/09/2011 at 01:58AM

17
#45 - derp derp / @derp__

01/09/2011 at 03:21AM

17
#46 - Steve Morrow / @yawmark

01/10/2011 at 03:09AM

17
#47 - Aaron Bull Schaefer / @elasticdog

01/11/2011 at 06:34PM

17
#48 - Remigijus (ReekenX) / @reekenx

01/12/2011 at 01:15PM

17
#49 - SirVer / @SirVerII

01/23/2011 at 12:17AM

17
#50 - vg / @vimgolfer

01/27/2011 at 11:56AM

17
#51 - Sergey Doroshenko / @dorserg

03/09/2011 at 08:31AM

17
#52 - Wyciorr / @wyciorr

04/14/2011 at 11:51AM

17
#53 - Dragan Cvetinovic / @kawkafi

04/20/2011 at 11:19PM

17
#54 - Andrew Nordman / @Cadwallion

05/29/2011 at 04:14AM

17
#55 - not so punk :] / @notsopunk

06/19/2011 at 12:41PM

17
#56 - Jim Infield / @jinfield

07/19/2011 at 03:40PM

17
#57 - Ben Somers / @somanyrobots

11/30/2011 at 01:39AM

17
#58 - Xavier Nayrac / @lkdjiin

01/07/2012 at 09:06PM

17
#59 - Vasil Sakarov / @vsakarov

01/15/2012 at 08:50PM

17
#60 - deroguerre / @DeroguerreGui

06/05/2013 at 12:56PM