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

226 active golfers, 765 entries

Leaderboard (lowest score wins):
28
#181 - phe / @phelipetls

09/22/2019 at 02:12PM

28
#182 - Daniel Rollins / @DanielJRollins

10/25/2019 at 02:18PM

28
#183 - rr / @rodgeur31

10/25/2019 at 10:43PM

28
#184 - Alex Emelianov / @AlexEmelianov3

10/26/2019 at 12:54AM

28
#185 - Yasky / @Yaasky

11/01/2019 at 05:18PM

28
#186 - damien / @GreatTestyTest

11/10/2019 at 10:54PM

28
#187 - glopz / @gl0pz

12/08/2019 at 09:14PM

28
#188 - Isaak Meier / @IsaakMeier

12/12/2019 at 03:16AM

28
#189 - beew71493 / @beew71493

01/27/2020 at 05:36AM

28
#190 - Falafel Palapel / @falafelpalapel

02/16/2020 at 06:02PM

28
#191 - Mack Hutsell / @sellshuts

06/15/2020 at 01:31AM

28
#192 - dotvimrc / @dotvimrc1

07/07/2020 at 06:44AM

28
#193 - Kaustubh Murumkar / @k_austub_h

08/31/2020 at 08:14PM

28
#194 - Eric Banisadr / @ebanisadr

12/13/2020 at 11:25AM

29
#195 - greengreen / @greengr09073862

09/06/2019 at 04:58PM

29
#196 - Abner jr / @Abnerjr19

09/09/2019 at 02:55AM

29
#197 - Jose Soto / @JoseCanHelp

09/10/2019 at 03:30AM

29
#198 - Benjamin Pelletier / @benjipelletier

09/25/2019 at 08:45PM

29
#199 - Jonathan Medwig / @jmedwig

10/15/2019 at 02:32PM

29
#200 - Emil Braserud / @Erdustiggen

11/08/2019 at 05:21PM

29
#201 - majo senf / @majo_senf

07/14/2020 at 08:58AM

29
#202 - Theo Sarrazin / @tshaero

08/18/2020 at 02:00PM

29
#203 - Ray Dennis / @raysden

01/11/2021 at 03:16PM

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

09/08/2019 at 03:35AM

30
#205 - Iggy / @iggredible

09/10/2019 at 03:48AM

30
#206 - ENSORIZATION / @ensorization

11/01/2019 at 11:50PM

31
#207 - Jacob Shomstein / @jshoms

07/25/2020 at 04:23AM

31
#208 - fff / @fff51460170

02/20/2021 at 04:09PM

31
#209 - x03n046 / @x03n046

05/06/2022 at 06:50AM

32
#210 - Raphael Marra / @rtmarra

09/06/2019 at 08:38PM