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

195 active golfers, 668 entries

Leaderboard (lowest score wins):
22
#61 - Hector Ricardo / @Hector_Ricardo3

12/05/2019 at 04:29PM

22
#62 - Jason Neylon / @jasonneylon

12/19/2019 at 06:41PM

22
#63 - James Casey / @hanavi

12/21/2019 at 02:42AM

22
#64 - Nik C / @nikclarx

01/28/2020 at 04:27AM

22
#65 - countime / @countime1

03/06/2020 at 06:05AM

22
#66 - floyd / @floyd10086

03/09/2020 at 05:30AM

22
#67 - Ryan Nevius / @ryannevius

03/22/2020 at 01:54PM

22
#68 - John Doe / @JohnDoe77150954

03/22/2020 at 05:47PM

22
#69 - RaylanFox / @RaylanFox

04/07/2020 at 05:50PM

22
#70 - GenericHardwareGamer / @GnrikHrdwrGamer

08/27/2020 at 08:25AM

22
#71 - Martin Bielik / @mabielik

09/05/2020 at 08:57PM

23
#72 - Καράτε Μόνο / @karate_mono

09/06/2019 at 02:56PM

23
#73 - garry quested / @GQuested

09/09/2019 at 09:12AM

23
#74 - Baine Wedlock / @BaineWedlock

09/11/2019 at 02:07PM

23
#75 - dicekest / @dicekest

09/15/2019 at 04:25AM

23
#76 - vimgolfer / @vimgolfer7

09/20/2019 at 07:33AM

23
#77 - Michał Łowicki / @mlowicki

10/12/2019 at 09:59PM

23
#78 - tuck cursed on rerB / @19emtuck

10/13/2019 at 07:25PM

23
#79 - Константин / @pillar_vandyke

10/17/2019 at 07:24PM

23
#80 - Renan Cidale / @rnescalz

10/21/2019 at 11:07PM

23
#81 - shota_ogswr / @shota_ogasawara

11/24/2019 at 02:36PM

23
#82 - King Kang / @nobagtravel

12/11/2019 at 09:49AM

23
#83 - Dan Kilman / @dan_kilman

12/19/2019 at 01:02PM

23
#84 - BnnGolfer / @BnnGolfer

03/26/2020 at 07:20PM

23
#85 - dule2607 / @dule26071

05/02/2020 at 08:24AM

24
#86 - Arijus / @argshook

09/06/2019 at 01:16PM

24
#87 - Norbert / @mullno

09/06/2019 at 03:21PM

24
#88 - Daniel Steinberg / @dstein64

09/06/2019 at 08:49PM

24
#89 - Ivo Blöchliger / @aigledesalpes

09/07/2019 at 01:04PM

24
#90 - tPenguinLTG / @tpenguinltg

09/08/2019 at 03:35AM