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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


#108 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


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


Created by: sermoa

120 active golfers, 305 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

16
#26 - Johan Sveholm / rymdtjuren

06/30/2011 at 05:40AM

16
#27 - xaizek / xaizek

07/17/2011 at 04:10PM

16
#28 - Peter Anselmo / peter_anselmo

03/08/2012 at 03:30PM

16
#29 - Frank Twitting / knarfben

07/14/2012 at 11:29PM

16
#30 - Sebastian Korten / FlashKorten

07/21/2012 at 02:54PM