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 53c66c482b4166000226bbee

Don't know what this is

Replace contents of brackets with matching number of spaces. Don't ask what the format's supposed to be.

Start file
[1:0]
[0:1]
[1:100]
[0:100]
End file
[   ]
[   ]
[     ]
[     ]

View Diff

1,4c1,4
< [1:0]
< [0:1]
< [1:100]
< [0:100]
---
> [   ]
> [   ]
> [     ]
> [     ]

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 586 remaining solutions by signing in and submitting your own entry
#587 luffy / @raxcoi - Score: 75 - 08/01/14 @ 13:29
:<Up><Up><Up>%s/[^\[\]]*/\=repeat()/g<Left><Left><Left><Left><Left><Left><Left><Left><Left><Right><Right><Right><Right><Right><Right><Right><Left>' ', strlen()<Left>submatch(0)<CR>:wq<CR>

0 comments


Created by: @udioica

587 active golfers, 2025 entries

Leaderboard (lowest score wins):
16
#511 - Steven Moazami / @mong8se

05/10/2016 at 01:19AM

16
#512 - Andres Araya / @arayaandresfco

05/15/2016 at 07:59PM

16
#513 - cohost.org/quiggy / @quiggy

05/18/2016 at 02:20PM

16
#514 - Ameen P / @Ameen_P1

06/23/2016 at 04:59PM

16
#515 - Timothy Caleb Nordlo / @tnordloh

06/30/2016 at 04:03AM

16
#516 - André Peric Tavares / @AndrePeric

07/24/2016 at 05:43PM

16
#517 - 알카포 / @alkpo12

09/09/2016 at 07:46AM

16
#518 - Ian van der Linde / @Ian_vdl

09/16/2016 at 04:16PM

16
#519 - Ilya Ezepov / @iezepov

12/05/2016 at 09:21AM

16
#520 - Colin Jacobs / @coljac

03/14/2017 at 11:52AM

16
#521 - Stop and think / @ms_uncountable

07/07/2017 at 11:14AM

16
#522 - Gurukandhamoorthi / @Gurukandhamoor1

07/10/2017 at 02:06PM

16
#523 - Ron Alexssen / @Ralexhere

11/08/2017 at 06:19PM

16
#524 - Spacesh1p / @spacesh1pdev

01/04/2018 at 10:26AM

16
#525 - Pereant osores / @viniciusxp

04/30/2018 at 08:04AM

16
#526 - z0c / @zerocabal

06/06/2018 at 02:00PM

16
#527 - ハヤシ / @0__098

07/25/2018 at 02:07PM

16
#528 - Jurica / @Jurica34581259

11/16/2018 at 12:27PM

16
#529 - PJ Frazer / @pj_frazer

11/22/2018 at 05:41PM

16
#530 - Michael Lemur / @mlemur123

11/28/2018 at 08:44AM

16
#531 - Graham Singer / @grahamsinger

01/19/2019 at 10:55PM

16
#532 - churaki / @churaki

01/26/2019 at 04:55AM

16
#533 - Zach Russell / @ZacharyRRussell

02/07/2019 at 04:21PM

16
#534 - Mateen Ulhaq / @sicariusnoctis

02/12/2019 at 09:05AM

16
#535 - Phoon / @justflashhim

05/10/2019 at 07:43PM

16
#536 - Frank / @fschoenm

07/22/2019 at 11:18AM

16
#537 - Christian / @paierlep

09/03/2019 at 10:14PM

16
#538 - Hans Lidiki / @HLidiki

09/07/2019 at 06:21PM

16
#539 - Timo Böhm / @TimoBohm

11/27/2019 at 07:32AM

16
#540 - Rory Smith / @alan0buchanan

09/14/2021 at 12:07AM