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
#541 - Justin Fisher / @justinfisherr

11/04/2024 at 04:52PM

16
#542 - _3tHeR_ / @3ther-joyboy

11/21/2024 at 03:11PM

16
#543 - Nathan Priego / @nspriego

02/22/2025 at 02:14AM

17
#544 - RobertT / @techrt2050

07/22/2014 at 03:35AM

17
#545 - James Ryland Miller / @longhornxtreme

07/29/2014 at 05:44AM

17
#546 - Alex / @ninjabassist777

07/30/2014 at 11:16PM

17
#547 - Justin Knag / @justinknag

08/28/2014 at 12:07PM

17
#548 - Cory Knapp / @coryknapp

09/26/2015 at 02:31AM

17
#549 - Jakob Schöttl / @jschoettl

12/20/2015 at 04:37AM

17
#550 - Feras / @faldah

04/24/2016 at 01:15AM

17
#551 - pankaj singh / @pankajsingh013

01/16/2019 at 10:54AM

17
#552 - Oren Koriat / @KoriatOren

01/17/2019 at 06:11PM

17
#553 - Jens / @jigfox

05/16/2022 at 06:09AM

18
#554 - Julius Hövel / @JulesFH

07/20/2014 at 03:16PM

18
#555 - Ryan O'Donnell / @bt_ryanodonnell

08/08/2014 at 03:58PM

18
#556 - Jonas / @j0na3

09/13/2014 at 10:00PM

18
#557 - Patrick Mitchell / @jpmitche11

10/10/2014 at 01:58AM

18
#558 - Yuval Goncz / @YGoncho

12/24/2014 at 11:14AM

18
#559 - d1uckym d1uckym / @d1uckym

02/16/2015 at 06:44AM

18
#560 - shugen / @shugeno

03/16/2015 at 10:33PM

18
#561 - ɐʇnɥsɐpoʇ / @todashuta

03/25/2015 at 09:02AM

18
#562 - Marcus Buffett / @MarcusBuffett

10/05/2015 at 07:16PM

18
#563 - TS / @tiredsounds

01/27/2016 at 05:09AM

18
#564 - Micha / @michman89

08/14/2016 at 04:30PM

18
#565 - James Potter / @JJPotterkowski

10/22/2016 at 04:13AM

18
#566 - Paul Inc / @hiniol1982

09/17/2017 at 04:54PM

18
#567 - Aioriya / @AioriyaDonk

09/07/2019 at 05:31PM

18
#568 - Kaustubh Murumkar / @k_austub_h

09/26/2020 at 12:46AM

19
#569 - Joseph Siddall / @jbsiddall

07/30/2014 at 02:52AM

19
#570 - Matthew Barrington / @mbarrin

07/30/2014 at 09:25PM