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 183 remaining solutions by signing in and submitting your own entry
#184 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

184 active golfers, 644 entries

Leaderboard (lowest score wins):
70
#181 - Bradley Cushing / @bradleycushing

09/08/2019 at 02:37PM

92
#182 - Eliseo / @Eliseohh_A

11/27/2019 at 02:38PM

100
#183 - Aaron / @_Lordofthevoid_

11/21/2019 at 05:05PM

108
#184 - Sergio Soares / @sergsoares

04/24/2020 at 03:25AM