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

75 active golfers, 202 entries

Leaderboard (lowest score wins):
22
#31 - Alex Linden / @alexwlinden1

04/20/2017 at 07:57PM

22
#32 - jakeroberts / @jakeroberts

05/27/2017 at 07:52PM

22
#33 - Jacob Buete / @JBuete

07/02/2017 at 02:50PM

22
#34 - DHM / @DHM29978992

04/30/2018 at 05:45PM

22
#35 - qed / @qed13308565

07/26/2018 at 02:09AM

23
#36 - Byaruhanga Franklin / @byaruhaf

10/10/2016 at 08:59PM

23
#37 - tPenguinLTG / @tpenguinltg

10/11/2016 at 12:42AM

23
#38 - Tuomas Poikela / @tuomaspoi

10/17/2016 at 09:18PM

23
#39 - Alan Turing / @alantrng

11/18/2016 at 12:20PM

23
#40 - Etienne Florent / @EtienneFlorent

11/22/2016 at 11:39AM

23
#41 - BlackCap / @BlackCapCoder

11/23/2016 at 05:05PM

23
#42 - Marcin / @Marcin89439917

12/31/2016 at 07:05AM

23
#43 - squid / @zerosquid

05/27/2017 at 03:18PM

23
#44 - Chenut Ludovic / @7Brwa7

04/19/2018 at 01:14PM

23
#45 - Brandon / @Brandon10678836

08/31/2022 at 09:30PM

24
#46 - Sebastian Korten / @FlashKorten

10/10/2016 at 04:20PM

24
#47 - Michael Prouty / @MProuts

10/11/2016 at 04:23PM

24
#48 - Christian Rondeau / @c_rondeau

10/13/2016 at 09:53PM

24
#49 - TweetDreams / @TweetMusicians

10/15/2016 at 04:19AM

24
#50 - Simon Plantinga / @SimonPlantinga

10/30/2016 at 11:59AM

25
#51 - Ted Myers / @fedorasaurus

10/10/2016 at 09:17PM

25
#52 - trx / @trxdbg

10/11/2016 at 11:58AM

25
#53 - i1464083 / @i1464083

11/18/2016 at 07:08PM

26
#54 - Anoop Kumar / @anooplive

10/10/2016 at 06:28PM

26
#55 - Lukas Kruemel / @KruemelKobold

10/13/2016 at 02:05PM

26
#56 - timerellaยฎ / @timerella

11/16/2016 at 11:53PM

26
#57 - Daniel Capo Sobral / @dcsobral

05/26/2017 at 10:50PM

27
#58 - Nicolรกs Alvarez / @nicoa_bb_ba_ar

02/18/2017 at 09:41PM

27
#59 - Michael Ficarra / @jspedant

05/26/2017 at 10:55PM

27
#60 - ๐šƒ๐š’๐š๐š˜๐šž๐šŠ๐š— ๐šƒ๐šŽ๐šข๐šœ๐šœ๐š’๐šŽ๐š› / @TitouanT_

03/03/2019 at 03:51PM