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 57fbb753ab6108077204f440

7th Birthday

We have a bunch of numbers written from 0 to 9 in the order present in the text input file. The task is to create 7 by replacing the numbers with dashes.

Start file
12345678901234
23456789012345
34567890123456
45678901234567
56789012345678
67890123456789
78901234567890
89012345678901
90123456789012
End file
12-----------
2--56789012--5
3456789012--56
456789012--567
56789012--5678
6789012--56789
789012--567890
89012--5678901
9012--56789012

View Diff

1,9c1,9
< 12345678901234
< 23456789012345
< 34567890123456
< 45678901234567
< 56789012345678
< 67890123456789
< 78901234567890
< 89012345678901
< 90123456789012
---
> 12-----------
> 2--56789012--5
> 3456789012--56
> 456789012--567
> 56789012--5678
> 6789012--56789
> 789012--567890
> 89012--5678901
> 9012--56789012

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 45 remaining solutions by signing in and submitting your own entry
#46 Nicolás Alvarez / nicoa_bb_ba_ar - Score: 27 - 02/18/17 @ 21:41
llv$r-x:%s/34/--/g<CR>3GR34<Esc>ZZ

0 comments

#47 Michael Ficarra / jspedant - Score: 27 - 05/26/17 @ 22:55
<Down>R2--<Esc><Up>v$r-$xqa<Down>r-<Left>r-q7@aZZ

0 comments

#48 Jon E. Eguiluz / viroide - Score: 28 - 10/11/16 @ 09:31
:%s/.\zs34/--/g<CR>ggf5v8lr-xZZ

0 comments

#49 Apox / apox159 - Score: 28 - 11/27/16 @ 20:01
ll12r-x:%s/34/--/g<CR>3G2s34<Esc>ZZ

0 comments

#50 Michał Dytko / DytkoM - Score: 28 - 12/21/16 @ 11:05
$xvF3r-:%s/34/--/g<CR>3Gr3lr4ZZ

0 comments

#51 andresote / andresote - Score: 28 - 02/18/17 @ 21:43
llv$-r-x:%s/34/--/g<CR>3GR34<Esc>ZZ

0 comments

#52 Pradeep Kumar / pradeep6kumar - Score: 29 - 10/10/16 @ 16:44
:%s/^\@<!34/--/g<CR>ggf5v8lr-xZZ

0 comments

#53 Hans Yelek / hans_yelek - Score: 29 - 01/13/17 @ 19:09
:%s/34/--/g<CR>3GR34<Esc>Hf-v$r-$xZZ

0 comments

#54 Solomon / Trugbildjaeger - Score: 29 - 04/15/17 @ 14:24
llv$r-x:s<BS>%s/34/--/g<CR>3GR34<Esc>ZZ

0 comments

#55 Dmitry Teslenko / krab_mozga - Score: 30 - 06/27/17 @ 07:46
$xvF3r-:%s/34/--/g<CR>3Gr31<Esc>lr4ZZ

0 comments

#56 Gurukandhamoorthi / Gurukandhamoor1 - Score: 33 - 07/13/17 @ 12:00
llv$r-$x<Esc>j0lr-lr-$hqqr-hr-jq7@qZZ

0 comments

#57 captain_morgan / captain_morgan - Score: 41 - 10/17/16 @ 21:08
  v$r-$x<CR>:s/34/--/g<CR><CR>/<CR>R--<Esc><CR>VG:s/34/--<CR>ZZ

0 comments

Created by: pradeep6kumar

57 active golfers, 130 entries

Leaderboard (lowest score wins):
19
#1 - Urtica dioica / udioica

10/11/2016 at 02:33AM

19
#2 - Stanislav / prstad

10/11/2016 at 08:06AM

19
#3 - Nikos Kwlos / Kwlos_Calling

10/11/2016 at 08:24PM

19
#4 - Jon Krause / jkrause314

10/12/2016 at 07:26AM

19
#5 - John Braxler / braxler

10/13/2016 at 03:12PM

19
#6 - Nico / _Nico_Caro

10/14/2016 at 03:26AM

19
#7 - mk61 / aringba

10/14/2016 at 10:17AM

19
#8 - Josh Callender / Saponifi3d

10/17/2016 at 01:46AM

19
#9 - Brian Mego / Major251

10/17/2016 at 03:27AM

19
#10 - John Barbero Unenge / JBarberU

10/19/2016 at 11:44AM

19
#11 - Bill Ruddock / biinari

10/31/2016 at 02:48AM

19
#12 - Davis Fields / i301585

11/04/2016 at 10:50PM

19
#13 - Marin Usalj / _supermarin

11/09/2016 at 11:59PM

19
#14 - Jon Louie / jjisnow

11/24/2016 at 02:50AM

19
#15 - Liam S Ismail / AC01Y

12/06/2016 at 06:36PM

19
#16 - Colby Hamilton / ColbyHamilton5

04/20/2017 at 08:06PM

20
#17 - Kerson Hsiao / KersonHsiao

10/30/2016 at 08:31AM

20
#18 - Saki Gw / Sakigw

11/02/2016 at 03:33PM

20
#19 - Daniel / Daniel00288663

03/27/2017 at 12:10PM

21
#20 - Smylers / Smylers2

10/10/2016 at 06:52PM

22
#21 - mnx / mnxx

11/14/2016 at 02:14PM

22
#22 - Benedikt Ames / wisp3rwind

01/29/2017 at 07:15PM

22
#23 - Alex Linden / alexwlinden1

04/20/2017 at 07:57PM

22
#24 - jakeroberts / jakeroberts

05/27/2017 at 07:52PM

22
#25 - Jacob Buete / JBuete

07/02/2017 at 02:50PM

23
#26 - Byaruhanga Franklin / byaruhaf

10/10/2016 at 08:59PM

23
#27 - tPenguinLTG / tpenguinltg

10/11/2016 at 12:42AM

23
#28 - Tuomas Poikela / tuomaspoi

10/17/2016 at 09:18PM

23
#29 - Alan Turing / alantrng

11/18/2016 at 12:20PM

23
#30 - Etienne Florent / EtienneFlorent

11/22/2016 at 11:39AM

23
#31 - BlackCap / BlackCapCoder

11/23/2016 at 05:05PM

23
#32 - Marcin / Marcin89439917

12/31/2016 at 07:05AM

23
#33 - squid / zerosquid

05/27/2017 at 03:18PM

24
#34 - Sebastian Korten / FlashKorten

10/10/2016 at 04:20PM

24
#35 - Michael Prouty / MProuts

10/11/2016 at 04:23PM

24
#36 - Christian Rondeau / c_rondeau

10/13/2016 at 09:53PM

24
#37 - TweetDreams / TweetMusicians

10/15/2016 at 04:19AM

24
#38 - Simon Plantinga / SimonPlantinga

10/30/2016 at 11:59AM

25
#39 - Ted Myers / fedorasaurus

10/10/2016 at 09:17PM

25
#40 - trx / trxdbg

10/11/2016 at 11:58AM

25
#41 - i1464083 / i1464083

11/18/2016 at 07:08PM

26
#42 - Anoop Kumar / anooplive

10/10/2016 at 06:28PM

26
#43 - Lukas Kruemel / KruemelKobold

10/13/2016 at 02:05PM

26
#44 - timerella® / timerella

11/16/2016 at 11:53PM

26
#45 - Daniel Capo Sobral / dcsobral

05/26/2017 at 10:50PM

27
#46 - Nicolás Alvarez / nicoa_bb_ba_ar

02/18/2017 at 09:41PM

27
#47 - Michael Ficarra / jspedant

05/26/2017 at 10:55PM

28
#48 - Jon E. Eguiluz / viroide

10/11/2016 at 09:31AM

28
#49 - Apox / apox159

11/27/2016 at 08:01PM

28
#50 - Michał Dytko / DytkoM

12/21/2016 at 11:05AM

28
#51 - andresote / andresote

02/18/2017 at 09:43PM

29
#52 - Pradeep Kumar / pradeep6kumar

10/10/2016 at 04:44PM

29
#53 - Hans Yelek / hans_yelek

01/13/2017 at 07:09PM

29
#54 - Solomon / Trugbildjaeger

04/15/2017 at 02:24PM

30
#55 - Dmitry Teslenko / krab_mozga

06/27/2017 at 07:46AM

33
#56 - Gurukandhamoorthi / Gurukandhamoor1

07/13/2017 at 12:00PM

41
#57 - captain_morgan / captain_morgan

10/17/2016 at 09:08PM