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

216 active golfers, 724 entries

Leaderboard (lowest score wins):
28
#181 - Falafel Palapel / @falafelpalapel

02/16/2020 at 06:02PM

28
#182 - Mack Hutsell / @sellshuts

06/15/2020 at 01:31AM

28
#183 - dotvimrc / @dotvimrc1

07/07/2020 at 06:44AM

28
#184 - Kaustubh Murumkar / @k_austub_h

08/31/2020 at 08:14PM

28
#185 - quemeraisc / @quemeraisc

11/06/2020 at 04:23PM

28
#186 - Eric Banisadr / @ebanisadr

12/13/2020 at 11:25AM

29
#187 - greengreen / @greengr09073862

09/06/2019 at 04:58PM

29
#188 - Abner jr / @Abnerjr19

09/09/2019 at 02:55AM

29
#189 - Jose Soto / @JoseCanHelp

09/10/2019 at 03:30AM

29
#190 - Benjamin Pelletier / @benjipelletier

09/25/2019 at 08:45PM

29
#191 - Jonathan Medwig / @jmedwig

10/15/2019 at 02:32PM

29
#192 - Emil Braserud / @Erdustiggen

11/08/2019 at 05:21PM

29
#193 - majo senf / @majo_senf

07/14/2020 at 08:58AM

29
#194 - Theo Sarrazin / @tshaero

08/18/2020 at 02:00PM

29
#195 - Ray Dennis / @raysden

01/11/2021 at 03:16PM

30
#196 - 5th Human on Mars / @JoshTheWhite

09/08/2019 at 03:35AM

30
#197 - Iggy / @iggredible

09/10/2019 at 03:48AM

30
#198 - ENSORIZATION / @ensorization

11/01/2019 at 11:50PM

31
#199 - Jacob Shomstein / @jshoms

07/25/2020 at 04:23AM

32
#200 - Raphael Marra / @rtmarra

09/06/2019 at 08:38PM

32
#201 - Ralph Callaway / @RalphAtCCC

09/13/2019 at 09:03AM

32
#202 - Khamnhoui-Boulom / @k_nhoui

09/16/2019 at 11:47AM

32
#203 - EL KESRI Othmane / @KesriOthmane

09/16/2019 at 01:35PM

32
#204 - 5m0r14x / @5m0r14x

01/11/2020 at 12:25AM

35
#205 - asfsef / @asfsef5

09/12/2019 at 01:50AM

35
#206 - Alex Bartol / @alexbartol

09/13/2019 at 12:24AM

38
#207 - Alexey Kuntsevich / @jezzarax

09/09/2019 at 09:59AM

43
#208 - Howl / @Howlxx55

11/08/2019 at 05:48PM

43
#209 - justinhj / @justinhj

12/31/2020 at 04:16AM

44
#210 - Di Liu / @Skyerliu

06/21/2020 at 03:27AM