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):
27
#61 - James / @Dronak

01/11/2023 at 09:10PM

27
#62 - jonas-grobe / @jonas-grobe

02/03/2024 at 10:01PM

28
#63 - Jon E. Eguiluz ๐Ÿณ๏ธโ€๐ŸŒˆ / @viroide

10/11/2016 at 09:31AM

28
#64 - Apox / @apox159

11/27/2016 at 08:01PM

28
#65 - Michaล‚ Dytko / @DytkoM

12/21/2016 at 11:05AM

28
#66 - andresote / @andresote

02/18/2017 at 09:43PM

28
#67 - RockerZZY / @rocker_zzy

06/30/2020 at 03:54PM

29
#68 - Pradeep Kumar ๐Ÿ‡ฎ๐Ÿ‡ณ๐Ÿ‡ฎ๐Ÿ‡ณ๐Ÿ‡ฎ๐Ÿ‡ณ๐Ÿ‡ฎ๐Ÿ‡ฑ๐Ÿ‡ฎ๐Ÿ‡ฑ๐Ÿ‡ฎ๐Ÿ‡ฑ / @pradeep6kumar

10/10/2016 at 04:44PM

29
#69 - Hans Yelek / @hans_yelek

01/13/2017 at 07:09PM

29
#70 - Solomon / @Trugbildjaeger

04/15/2017 at 02:24PM

30
#71 - Dmitry Teslenko / @krab_mozga

06/27/2017 at 07:46AM

30
#72 - Jurica / @Jurica34581259

12/11/2018 at 03:08PM

31
#73 - Petar Saulic / @gorillawarfare9

10/27/2017 at 12:41PM

33
#74 - Gurukandhamoorthi / @Gurukandhamoor1

07/13/2017 at 12:00PM

41
#75 - captain_morgan / @captain_morgan

10/17/2016 at 09:08PM