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):
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

19
#17 - Turkey Man / @lvturkeyman

11/23/2017 at 06:03PM

19
#18 - Daniël De Koker / @daniel_koker

07/25/2018 at 09:50PM

19
#19 - Miłosz Łakomy / @foobar01123

07/02/2020 at 09:28AM

19
#20 - Peppa Pig / @PeppaPi95550250

07/02/2024 at 09:56PM

19
#21 - nickGPT / @nickandbro

08/28/2024 at 03:03AM

20
#22 - Kerson Hsiao / @KersonHsiao

10/30/2016 at 08:31AM

20
#23 - Saki Gw / @Sakigw

11/02/2016 at 03:33PM

20
#24 - Daniel / @Daniel00288663

03/27/2017 at 12:10PM

20
#25 - Mihai / @mihaicristiant

02/27/2019 at 02:39PM

20
#26 - Lory / @Lory46845742

12/18/2019 at 03:43PM

20
#27 - Jean George / @JeanGeo20504212

04/06/2022 at 09:20AM

21
#28 - Smylers / @Smylers2

10/10/2016 at 06:52PM

22
#29 - mnx / @mnxx

11/14/2016 at 02:14PM

22
#30 - Benedikt Ames / @wisp3rwind

01/29/2017 at 07:15PM