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

134 active golfers, 358 entries

Leaderboard (lowest score wins):
15
#1 - Rob Ciaccio / @RobertoCalavera

01/20/2011 at 04:17AM

15
#2 - Michał Taszycki / @mehowte

01/24/2011 at 11:11AM

15
#3 - Pavlo Klets / @p01nt

03/19/2011 at 09:20AM

15
#4 - Wei Dai / @clvv42

05/06/2011 at 04:12AM

15
#5 - Zak van der Merwe / @zakkuuu

07/07/2011 at 07:41PM

15
#6 - Hu Junfeng / @junfeng

07/30/2011 at 02:56PM

15
#7 - Justin Love / @wondible

08/29/2011 at 03:56PM

15
#8 - Jesús Espino / @jespinog

09/06/2011 at 04:24PM

15
#9 - You-Siang Lin / @yslinnctu

12/01/2011 at 07:43AM

15
#10 - Jakub Arnold / @darthdeus

12/19/2011 at 04:24PM

15
#11 - Rik Lomas / @riklomas

12/30/2011 at 12:19AM

15
#12 - Tesnorth / @Tesnorth

01/31/2012 at 08:35PM

15
#13 - Renat Aksitov / @Korvin79

02/16/2012 at 12:51PM

15
#14 - Urtica dioica / @udioica

06/26/2012 at 11:21PM

15
#15 - John Dahlström / @dahlstromjohn

06/27/2012 at 09:00PM

15
#16 - Federico Galassi / @federicogalassi

07/14/2012 at 06:08PM

15
#17 - Kerson Hsiao / @KersonHsiao

08/14/2012 at 04:27AM

15
#18 - Drew Neil / @nelstrom

11/27/2012 at 12:32AM

15
#19 - Petro Тrouq / @zulolosi

08/31/2013 at 05:03PM

15
#20 - Anton Davydov / @anton_davydov

01/05/2014 at 12:01PM

15
#21 - Joonas Pihlajamaa / @jokkebk

02/21/2014 at 03:04PM

15
#22 - John Braxler / @braxler

05/22/2014 at 06:16PM

15
#23 - Felix / @DoubleFelix_

02/24/2015 at 09:50AM

15
#24 - Jon Krause / @jkrause314

01/29/2016 at 12:05AM

15
#25 - Turkey Man / @lvturkeyman

12/05/2017 at 02:30PM

15
#26 - Mihai / @mihaicristiant

04/08/2019 at 10:50AM

15
#27 - blabla zincou / @BZincou

03/24/2022 at 05:21PM

15
#28 - russellzhaomao / @russellzhaomao

05/31/2022 at 10:39AM

15
#29 - Jean George / @JeanGeo20504212

06/01/2022 at 09:30PM

15
#30 - Peppa Pig / @PeppaPi95550250

07/03/2024 at 08:26AM