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 197 remaining solutions by signing in and submitting your own entry
#198 Sergio Soares / @sergsoares - Score: 108 - 04/24/20 @ 03:25
:$<BS>%s/, <BS>/ = ''m<BS>,/g<CR><C-C><C-C>a<C-C><C-C>eeeli<C-C><C-C>iUNKNOWN<C-C><C-C>bkehiPUP<BS>PPETEER<C-C><C-C>kbaPROTA<BS>RACTOR<C-C><C-C>kbaUNIDRIVER<C-C><C-C>kbaVANILLA<C-C><C-C>:wq<CR>

0 comments


Created by: @argshook

198 active golfers, 678 entries

Leaderboard (lowest score wins):
30
#181 - Iggy / @iggredible

09/10/2019 at 03:48AM

30
#182 - ENSORIZATION / @ensorization

11/01/2019 at 11:50PM

31
#183 - Jacob Shomstein / @jshoms

07/25/2020 at 04:23AM

32
#184 - Raphael Marra / @rtmarra

09/06/2019 at 08:38PM

32
#185 - Ralph Callaway / @RalphAtCCC

09/13/2019 at 09:03AM

32
#186 - Khamnhoui-Boulom / @k_nhoui

09/16/2019 at 11:47AM

32
#187 - EL KESRI Othmane / @KesriOthmane

09/16/2019 at 01:35PM

32
#188 - 5m0r14x / @5m0r14x

01/11/2020 at 12:25AM

35
#189 - asfsef / @asfsef5

09/12/2019 at 01:50AM

35
#190 - Alex Bartol / @alexbartol

09/13/2019 at 12:24AM

38
#191 - Alexey Kuntsevich / @jezzarax

09/09/2019 at 09:59AM

43
#192 - Howl / @Howlxx55

11/08/2019 at 05:48PM

44
#193 - Di Liu / @Skyerliu

06/21/2020 at 03:27AM

47
#194 - julio marins / @AJ07mm

09/09/2019 at 04:42PM

70
#195 - Bradley Cushing / @bradleycushing

09/08/2019 at 02:37PM

92
#196 - Eliseo / @Eliseohh_A

11/27/2019 at 02:38PM

100
#197 - Aaron / @_Lordofthevoid_

11/21/2019 at 05:05PM

108
#198 - Sergio Soares / @sergsoares

04/24/2020 at 03:25AM