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):
23
#91 - Renan Cidale / @rnescalz

10/21/2019 at 11:07PM

23
#92 - shota_ogswr / @shota_ogasawara

11/24/2019 at 02:36PM

23
#93 - King Kang / @nobagtravel

12/11/2019 at 09:49AM

23
#94 - Dan Kilman / @dan_kilman

12/19/2019 at 01:02PM

23
#95 - BnnGolfer / @BnnGolfer

03/26/2020 at 07:20PM

23
#96 - dule2607 / @dule26071

05/02/2020 at 08:24AM

23
#97 - traplover / @traplov78528337

01/17/2021 at 08:12PM

24
#98 - Arijus / @argshook

09/06/2019 at 01:16PM

24
#99 - Norbert / @mullno

09/06/2019 at 03:21PM

24
#100 - Daniel Steinberg / @dstein64

09/06/2019 at 08:49PM

24
#101 - Ivo Blöchliger / @aigledesalpes

09/07/2019 at 01:04PM

24
#102 - tPenguinLTG / @tpenguinltg

09/08/2019 at 03:35AM

24
#103 - Bradley M. Small / @BradleySmall

09/10/2019 at 02:18AM

24
#104 - yesuu / @yesuu15

09/11/2019 at 11:38AM

24
#105 - Ole / @Ole_Lnkoje

09/15/2019 at 04:01PM

24
#106 - Andrey / @andreyrmg

09/16/2019 at 02:46PM

24
#107 - Ollin Boer Bohan / @madebyollin

09/22/2019 at 03:50PM

24
#108 - José / @AngelGaldamez

09/23/2019 at 01:31AM

24
#109 - Miko / @_m_ik_o_

09/24/2019 at 07:44PM

24
#110 - GrimmT / @GrimmT10

11/01/2019 at 06:21PM

24
#111 - Kevin Yokley / @kyokley19

11/03/2019 at 09:55PM

24
#112 - sapir malka / @sapir5522

12/26/2019 at 08:49AM

24
#113 - Michael Meixner / @meixner62

01/22/2020 at 05:25PM

24
#114 - Daniel Amkær Sørensen / @AmkRensen

02/04/2020 at 09:53AM

24
#115 - Harsh Raj / @harshraj22aug

04/06/2020 at 06:52PM

24
#116 - volandkit / @volandkit

04/20/2020 at 11:21PM

24
#117 - Filipe Brandenburger / @filbranden

08/14/2020 at 04:24AM

24
#118 - Martin Kauppinen / @MartinKauppinen

08/16/2020 at 12:31PM

25
#119 - Bennett / @bennettbackward

09/11/2019 at 09:56AM

25
#120 - arsi arola / @mos_kiitto

09/13/2019 at 08:23PM