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 5d7259d2c0248a000c157f9f

Add string initializers to an enum

Change Typescript enum so that it has string initializers.

Start file
const enum TestkitType {
  vanilla,
  unidriver,
  protractor,
  puppeteer,
  unknown,
}
End file
const enum TestkitType {
  vanilla = 'VANILLA',
  unidriver = 'UNIDRIVER',
  protractor = 'PROTRACTOR',
  puppeteer = 'PUPPETEER',
  unknown = 'UNKNOWN',
}

View Diff

2,6c2,6
<   vanilla,
<   unidriver,
<   protractor,
<   puppeteer,
<   unknown,
---
>   vanilla = 'VANILLA',
>   unidriver = 'UNIDRIVER',
>   protractor = 'PROTRACTOR',
>   puppeteer = 'PUPPETEER',
>   unknown = 'UNKNOWN',

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 112 remaining solutions by signing in and submitting your own entry
#113 Bradley Cushing / @bradleycushing - Score: 70 - 09/08/19 @ 14:37
:<50-53>:%s/\v(\w+),/\1 = '\U\1',/g<Esc>[201~<Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Right><BS><CR><Esc>:x<CR>

0 comments


Created by: @argshook

113 active golfers, 386 entries

Leaderboard (lowest score wins):
21
#1 - Saki Gw / @Sakigw

09/06/2019 at 01:27PM

21
#2 - Smylers / @Smylers2

09/06/2019 at 02:35PM

21
#3 - Zach Ingbretsen / @ZIngbretsen

09/06/2019 at 03:47PM

21
#4 - Christopher Weyand / @swordman378

09/06/2019 at 04:01PM

21
#5 - John Braxler / @braxler

09/06/2019 at 07:35PM

21
#6 - theBecwar / @thebecwar

09/07/2019 at 01:18PM

21
#7 - Zack Golden / @snedlog

09/07/2019 at 08:13PM

21
#8 - Jon Krause / @jkrause314

09/08/2019 at 05:03PM

21
#9 - Andrzej Wąsowski / @AndrzejWasowski

09/08/2019 at 05:31PM

21
#10 - A / @777Android777

09/08/2019 at 06:47PM

21
#11 - averageRandomPerson / @averageRandomP1

09/08/2019 at 10:00PM

21
#12 - Tosiaki / @Tosiaki1

09/13/2019 at 10:44PM

21
#13 - Josh Cummings / @jcummingsdesign

09/13/2019 at 11:14PM

21
#14 - Cassandra / @kascein

09/17/2019 at 05:31AM

21
#15 - blub / @agorilladriving

09/17/2019 at 01:57PM

21
#16 - Viktor Styrud / @Visklol

09/19/2019 at 08:36AM

21
#17 - Sebastien Baudray / @sbaudray

09/30/2019 at 07:01PM

21
#18 - Pieter Joost / @pjvds

10/09/2019 at 06:03PM

21
#19 - Sam O'Malley / @Samuel_OMalley

10/11/2019 at 04:02PM

21
#20 - kkscr / @kkscr1

10/13/2019 at 02:04PM

21
#21 - Mario Olofo / @mario_olofo

10/16/2019 at 08:39PM

21
#22 - leo / @leo28356948

10/17/2019 at 08:25AM

21
#23 - Erik Engstrom / @eengstrom

10/18/2019 at 09:40PM

21
#24 - Ivan Volosyuk / @IvanVolosyuk

10/19/2019 at 09:28AM

21
#25 - Tamás Kárándi / @tkarandi

10/19/2019 at 01:41PM

21
#26 - harmony_krieg / @harmony_krieg

10/27/2019 at 08:58AM

21
#27 - Gregory Furter / @gfurter

10/27/2019 at 07:03PM

21
#28 - dahan / @dahan74265266

10/28/2019 at 12:50PM

21
#29 - skamgolf / @skamgolf

11/05/2019 at 01:36AM

21
#30 - Melvin Cheung / @MelvinCheung

11/07/2019 at 03:36PM