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 9v0066f4e39400000000040b

Append leading hyphen count to each line

Append the number of leading hyphens to the end of each line.

Start file
----------bc4-099-80---e312--07b
------7205--4fbe93--e35--3539a79
-------------f00a5-2175------d81
---------f4e4cc18-6b7-9989e21033
------------47b28d1ae0-8-161e0c6
-------------------6de678f--a6e8
-----------------------b--e353f8
-------6eb-8--9--78391f-a3-1-3d0
-----------------eb165---5a5-0b0
---------------------9f7-9--c8e3
---------------09780---a37-----a
-------723cd51eae27-c82--78----9
-----------a48aba537182----160c1
--------0e5e1ab736-------ecbd18c
----------------7ce72d03e1-d03-1
--------------------ee1-9fb1e3f8
End file
----------bc4-099-80---e312--07b 10
------7205--4fbe93--e35--3539a79 6
-------------f00a5-2175------d81 13
---------f4e4cc18-6b7-9989e21033 9
------------47b28d1ae0-8-161e0c6 12
-------------------6de678f--a6e8 19
-----------------------b--e353f8 23
-------6eb-8--9--78391f-a3-1-3d0 7
-----------------eb165---5a5-0b0 17
---------------------9f7-9--c8e3 21
---------------09780---a37-----a 15
-------723cd51eae27-c82--78----9 7
-----------a48aba537182----160c1 11
--------0e5e1ab736-------ecbd18c 8
----------------7ce72d03e1-d03-1 16
--------------------ee1-9fb1e3f8 20

View Diff

1,16c1,16
< ----------bc4-099-80---e312--07b
< ------7205--4fbe93--e35--3539a79
< -------------f00a5-2175------d81
< ---------f4e4cc18-6b7-9989e21033
< ------------47b28d1ae0-8-161e0c6
< -------------------6de678f--a6e8
< -----------------------b--e353f8
< -------6eb-8--9--78391f-a3-1-3d0
< -----------------eb165---5a5-0b0
< ---------------------9f7-9--c8e3
< ---------------09780---a37-----a
< -------723cd51eae27-c82--78----9
< -----------a48aba537182----160c1
< --------0e5e1ab736-------ecbd18c
< ----------------7ce72d03e1-d03-1
< --------------------ee1-9fb1e3f8
---
> ----------bc4-099-80---e312--07b 10
> ------7205--4fbe93--e35--3539a79 6
> -------------f00a5-2175------d81 13
> ---------f4e4cc18-6b7-9989e21033 9
> ------------47b28d1ae0-8-161e0c6 12
> -------------------6de678f--a6e8 19
> -----------------------b--e353f8 23
> -------6eb-8--9--78391f-a3-1-3d0 7
> -----------------eb165---5a5-0b0 17
> ---------------------9f7-9--c8e3 21
> ---------------09780---a37-----a 15
> -------723cd51eae27-c82--78----9 7
> -----------a48aba537182----160c1 11
> --------0e5e1ab736-------ecbd18c 8
> ----------------7ce72d03e1-d03-1 16
> --------------------ee1-9fb1e3f8 20

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 26 remaining solutions by signing in and submitting your own entry
#27 SRINIVASU SALADI / @SRINIVASUS22587 - Score: 64 - 03/25/25 @ 08:38
:%s/\v(^-+).*$/\=submatch <BS>(0).' '.count(submatch*<BS>(1),'-')/g<CR>ZZ

0 comments


Created by: @maharba6

27 active golfers, 84 entries

Leaderboard (lowest score wins):
23
#1 - Jean George / @JeanGeo20504212

10/05/2024 at 11:32PM

23
#2 - Peppa Pig / @PeppaPigSg

10/07/2024 at 02:47AM

23
#3 - got_windy / @insomnight

10/21/2024 at 01:48AM

23
#4 - John Braxler / @braxler

10/23/2024 at 02:36PM

23
#5 - Danilo J. S. Bellini 🥊🇧🇷 / @danilobellini

11/10/2024 at 12:45AM

24
#6 - Berel94 / @Berel94

10/27/2024 at 05:13PM

24
#7 - Leon Kacowicz / @leonkacowicz

05/05/2025 at 02:18PM

24
#8 - winter-loo / @winter-loo

05/30/2025 at 05:13AM

25
#9 - Pablo Acuna / @pacuna

10/03/2024 at 10:19PM

25
#10 - guyontristan / @guyontristan

10/21/2024 at 10:36AM

25
#11 - Chloe Brett / @chloebrett

11/12/2024 at 07:21AM

25
#12 - ashfinal / @ashfinal

01/25/2025 at 10:43AM

25
#13 - 0xf00ff00f / @0xf00ff00f

02/09/2025 at 09:43PM

25
#14 - ak@developer / @Ajay-056

04/27/2025 at 01:59PM

25
#15 - Yordan Boikov / @yboikov

05/02/2025 at 02:53PM

25
#16 - Gibson Starkweather / @boaf

05/27/2025 at 11:52PM

27
#17 - Neix20 / @Neix20

10/03/2024 at 02:18AM

27
#18 - Melih Aktop / @mlhktp

10/22/2024 at 09:45PM

27
#19 - greg-asc / @greg-asc

06/06/2025 at 11:26PM

32
#20 - Luiz Carlos Vartuli / @ziul123

06/06/2025 at 04:21AM

32
#21 - migoohao / @migoohao

06/22/2025 at 01:37PM

36
#22 - JMTed / @JMTed

10/02/2024 at 01:56AM

50
#23 - GautR / @gautrr

05/14/2025 at 10:57PM

52
#24 - editor3D / @editor3D

11/20/2024 at 09:54PM

60
#25 - maharba6 / @maharba6

09/26/2024 at 04:51AM

60
#26 - jonas-grobe / @jonas-grobe

04/16/2025 at 07:11PM

64
#27 - SRINIVASU SALADI / @SRINIVASUS22587

03/25/2025 at 08:38AM