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 95 remaining solutions by signing in and submitting your own entry
#96 Shrikant Sharat / sharat87 - Score: 22 - 01/08/11 @ 13:55
jj:s/ :/<C-V><CR>:/g<CR>9I <Esc>k.ZZ

0 comments

#97 Victor Vaile / victorv4_ - Score: 22 - 01/08/11 @ 23:54
jyw:%s/ :/\r&/g<CR>4P-.ZZ

0 comments

#98 Nico / nicou - Score: 22 - 01/20/11 @ 23:58
:%s/ :/\r:/g<CR><C-V>k9I <Esc>:x<CR>

0 comments

#99 bestform / bestform - Score: 22 - 02/06/11 @ 15:02
:%s/ :/\r:/g<CR>9I <Esc>k0.ZZ

0 comments

#100 Cameron Fowler / camfowler - Score: 22 - 02/13/13 @ 04:33
jj:s/ :/<C-V><CR>:/g<CR>9I <Esc>k.ZZ

0 comments

#101 pikaren / REALpikaren - Score: 22 - 01/23/14 @ 12:52
jyw:%s/ :/\r&/g<CR>4P-.ZZ

0 comments

#102 James / Dronak - Score: 22 - 09/18/14 @ 20:41
:se et<CR>2jf,a<CR><Esc>2f,a<CR><Esc>ZZ

0 comments

#103 Brian Buckley / bbuckley - Score: 23 - 01/08/11 @ 14:48
:%s/ :/\r:/g<CR><C-V>k9I <Esc><Esc><Esc>ZZ

0 comments

#104 Dj Vimgolf / dj_vimgolf - Score: 23 - 12/31/11 @ 14:13
jjf,a<CR><BS><BS>         <Esc>;;.ZZ

0 comments

#105 無ん垢の叫び / john_ababa - Score: 23 - 02/26/12 @ 08:09
:3s/ :/<C-V><CR>        &/g<CR>ZZ

0 comments

#106 Arto Vuori / dhpe - Score: 23 - 09/01/12 @ 17:41
:3s/, /,\r/g<CR>9I <Esc>4G.JZZ

0 comments

#107 ltn614 / ltn614 - Score: 23 - 10/03/15 @ 13:37
/:<CR>ni<BS><CR><BS><BS><Esc>ni<BS><CR><Esc>9i <Esc>-.ZZ

0 comments

#108 Clive Evans / swish_bob - Score: 24 - 01/08/11 @ 17:08
:3s/ :/\r         :/g<CR>ZZ

0 comments

#109 Kylan Robinson / kylan - Score: 24 - 01/09/11 @ 16:32
:%s/ :/\r         :/g<CR>ZZ

0 comments

#110 Kurinniy Alexander / kurinniy - Score: 24 - 01/21/11 @ 14:49
:%s/ :/\r         :/g|x<CR>

0 comments

#111 Ravil Bayramgalin / brainopia - Score: 24 - 02/12/11 @ 18:31
jyw:%s/ :/\r%<BS>&/g<CR>4P-.ZZ

0 comments

#112 Mathias Bynens  / mathias - Score: 24 - 04/08/11 @ 08:13
jj:s/ /<BS>:/<C-V><CR>:/g<CR>9I <Esc>k.ZZ

0 comments

#113 Bryan Kendall / bkendall - Score: 24 - 06/02/11 @ 15:09
:%s% :%\r         :%g<CR>ZZ

0 comments

#114 johan wester / wester87 - Score: 24 - 11/12/11 @ 19:09
:%s/ :/\r         :/g<CR>ZZ

0 comments

#115 Ivo Dancet / caifara - Score: 24 - 12/04/11 @ 19:32
:%s/ :/\r         :/g<CR>ZZ

0 comments

#116 BlurredWeasel / BlurredWeasel - Score: 24 - 02/14/12 @ 05:56
:%s/ :/\r         :/g<CR>ZZ

0 comments

#117 Ben Friedland / bfriedland174 - Score: 24 - 05/21/12 @ 07:33
:%s/ :/\r:/g<CR>9i <Esc>k0.:wq<CR>

0 comments

#118 conor / omgconor - Score: 25 - 02/28/11 @ 23:47
:S<BS>%s/ :/\r:/g<CR>9I <Esc>k.zzZZ

0 comments

#119 Gurukandhamoorthi / Gurukandhamoor1 - Score: 25 - 08/22/17 @ 15:52
jj:s/ :/\r         :/g<CR>ZZ

0 comments

Created by: sermoa

119 active golfers, 301 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

16
#25 - Johan Sveholm / rymdtjuren

06/30/2011 at 05:40AM

16
#26 - xaizek / xaizek

07/17/2011 at 04:10PM

16
#27 - Peter Anselmo / peter_anselmo

03/08/2012 at 03:30PM

16
#28 - Frank Twitting / knarfben

07/14/2012 at 11:29PM

16
#29 - Sebastian Korten / FlashKorten

07/21/2012 at 02:54PM

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

01/08/2011 at 01:45PM

17
#31 - Matthew Draper / _matthewd

01/08/2011 at 01:48PM

17
#32 - Henrik Nyh / henrik

01/08/2011 at 01:49PM

17
#33 - Ujjwol Lamichhane / Ujjwol

01/08/2011 at 02:33PM

17
#34 - Tim Chase / gumnos

01/08/2011 at 03:08PM

17
#35 - Balkoth / _Balkoth_

01/08/2011 at 03:39PM

17
#36 - Douglas Stockwell / dstockwell

01/08/2011 at 06:01PM

17
#37 - Pete Johns / johnsyweb

01/08/2011 at 08:57PM

17
#38 - Soliman Sylvain / sylvain_soliman

01/08/2011 at 10:09PM

17
#39 - AD / golferTest101

01/08/2011 at 10:14PM

17
#40 - Utkarsh Kukreti / utkarshkukreti

01/09/2011 at 12:13AM

17
#41 - Francisco Dibar / frandibar

01/09/2011 at 01:58AM

17
#42 - derp derp / derp__

01/09/2011 at 03:21AM

17
#43 - Stephen Morrow / yawmark

01/10/2011 at 03:09AM

17
#44 - Aaron Bull Schaefer / elasticdog

01/11/2011 at 06:34PM

17
#45 - Remigijus (ReekenX) / reekenx

01/12/2011 at 01:15PM

17
#46 - SirVer / SirVerII

01/23/2011 at 12:17AM

17
#47 - vg / vimgolfer

01/27/2011 at 11:56AM

17
#48 - Sergey Doroshenko / dorserg

03/09/2011 at 08:31AM

17
#49 - Wyciorr / wyciorr

04/14/2011 at 11:51AM

17
#50 - Dragan Cvetinovic / kawkafi

04/20/2011 at 11:19PM

17
#51 - Andrew Nordman / Cadwallion

05/29/2011 at 04:14AM

17
#52 - not so punk :] / notsopunk

06/19/2011 at 12:41PM

17
#53 - Jim Infield / jinfield

07/19/2011 at 03:40PM

17
#54 - Ben Somers / somanyrobots

11/30/2011 at 01:39AM

17
#55 - Xavier Nayrac / lkdjiin

01/07/2012 at 09:06PM

17
#56 - Vasil Sakarov / vsakarov

01/15/2012 at 08:50PM

17
#57 - deroguerre / DeroguerreGui

06/05/2013 at 12:56PM

18
#58 - Israel Chauca F. / Raimondi

01/08/2011 at 02:50PM

18
#59 - Benoît Ryder / benoitryder

01/11/2011 at 08:53PM

18
#60 - drio / drio

01/18/2011 at 12:14AM

18
#61 - Kevin Hamer / khamer

01/19/2011 at 11:01PM

18
#62 - thorir danielsson / thorird

01/23/2011 at 11:03PM

18
#63 - Franco Lazzarino / flazz

01/29/2011 at 02:05AM

18
#64 - Tom Duijf / tomduijf

02/12/2011 at 04:39PM

18
#65 - Dave / zzdave13

07/24/2011 at 09:50PM

18
#66 - Ram Tamtam / ramtamtamtam

07/03/2014 at 07:46AM

19
#67 - Paul King / nrocy

01/08/2011 at 05:11PM

19
#68 - t_lini / t_lini

01/09/2011 at 11:51PM

19
#69 -  Ikhsan Maulana / ixandidu

01/14/2011 at 05:12PM

19
#70 - Aaron Kalin / martinisoft

03/01/2011 at 01:35AM

20
#71 - Daumantas / dbaltrus

05/04/2012 at 02:33PM

20
#72 - cj / cj01101

10/21/2013 at 10:45PM

20
#73 - ひげまにや / higemaniya

01/29/2014 at 03:14AM

21
#74 - Mattiassich Ákos / mattiassicha

01/08/2011 at 02:06PM

21
#75 - Josh Weinberg / jcweinberg

01/08/2011 at 04:35PM

21
#76 - Akira Matsuda / a_matsuda

01/08/2011 at 05:41PM

21
#77 - aaaa3331 / aaaa3331

01/08/2011 at 11:01PM

21
#78 - alex scott / 4l3xsc0tt

01/10/2011 at 01:49AM

21
#79 - Agus Lopez / aguslr

01/10/2011 at 08:54PM

21
#80 - Thomas Schönwälder / Masei1988

01/11/2011 at 11:02PM

21
#81 - Tien Le / tienlex

01/12/2011 at 02:37PM

21
#82 - Eric Weikl / ericweikl

01/16/2011 at 09:41PM

21
#83 - Andrey A. Ugolnik / andreyugolnik

01/19/2011 at 05:11PM

21
#84 - Dezső Zoltán / zakiazigazi

01/22/2011 at 10:33AM

21
#85 - Premium Ben / muppling

02/07/2011 at 07:51PM

21
#86 - Nomen Nescio / vadtusan

04/13/2011 at 10:04PM

21
#87 - Piotr Ślatała / pslapsla

04/25/2011 at 03:13PM

21
#88 - Pan Thomakos / panthomakos

04/27/2011 at 03:42PM

21
#89 - Lauri Tirkkonen / lotheac

07/01/2011 at 08:37PM

21
#90 - William Dunand / wdunand

11/15/2011 at 08:45AM

21
#91 - Christopher Brew / Seph1rothVII

01/12/2012 at 01:01AM

21
#92 - Ashley Feniello / AshleyFen

01/29/2012 at 07:27AM

21
#93 - James Freed / JamesTFreed

02/03/2012 at 01:16AM

21
#94 - JonLz / LzJon

12/26/2012 at 07:35PM

21
#95 - Timothée Gauthier / zmf_tim

07/25/2013 at 01:18PM

22
#96 - Shrikant Sharat / sharat87

01/08/2011 at 01:55PM

22
#97 - Victor Vaile / victorv4_

01/08/2011 at 11:54PM

22
#98 - Nico / nicou

01/20/2011 at 11:58PM

22
#99 - bestform / bestform

02/06/2011 at 03:02PM

22
#100 - Cameron Fowler / camfowler

02/13/2013 at 04:33AM

22
#101 - pikaren / REALpikaren

01/23/2014 at 12:52PM

22
#102 - James / Dronak

09/18/2014 at 08:41PM

23
#103 - Brian Buckley / bbuckley

01/08/2011 at 02:48PM

23
#104 - Dj Vimgolf / dj_vimgolf

12/31/2011 at 02:13PM

23
#105 - 無ん垢の叫び / john_ababa

02/26/2012 at 08:09AM

23
#106 - Arto Vuori / dhpe

09/01/2012 at 05:41PM

23
#107 - ltn614 / ltn614

10/03/2015 at 01:37PM

24
#108 - Clive Evans / swish_bob

01/08/2011 at 05:08PM

24
#109 - Kylan Robinson / kylan

01/09/2011 at 04:32PM

24
#110 - Kurinniy Alexander / kurinniy

01/21/2011 at 02:49PM

24
#111 - Ravil Bayramgalin / brainopia

02/12/2011 at 06:31PM

24
#112 - Mathias Bynens  / mathias

04/08/2011 at 08:13AM

24
#113 - Bryan Kendall / bkendall

06/02/2011 at 03:09PM

24
#114 - johan wester / wester87

11/12/2011 at 07:09PM

24
#115 - Ivo Dancet / caifara

12/04/2011 at 07:32PM

24
#116 - BlurredWeasel / BlurredWeasel

02/14/2012 at 05:56AM

24
#117 - Ben Friedland / bfriedland174

05/21/2012 at 07:33AM

25
#118 - conor / omgconor

02/28/2011 at 11:47PM

25
#119 - Gurukandhamoorthi / Gurukandhamoor1

08/22/2017 at 03:52PM