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

213 active golfers, 720 entries

Leaderboard (lowest score wins):
21
#31 - Daniel Klepacki / @daniel_klepacki

11/12/2019 at 06:24PM

21
#32 - mogitate / @mutemeat

11/14/2019 at 03:25PM

21
#33 - Matt Aschmann / @ma7hatter

11/14/2019 at 08:53PM

21
#34 - oldandslow / @oldandslow5

11/29/2019 at 10:45PM

21
#35 - Nicolas Pagny / @NicolasPagny

12/06/2019 at 04:09PM

21
#36 - Delon / @delonleonard

12/25/2019 at 06:41AM

21
#37 - nicosierra / @nicosierra84

01/09/2020 at 11:05PM

21
#38 - mowglian / @mowglian

01/13/2020 at 12:10PM

21
#39 - Karnival K / @K4rnival

01/18/2020 at 08:17PM

21
#40 - Tefe / @tefetic

01/31/2020 at 10:03PM

21
#41 - howanto / @ho_wan_

02/20/2020 at 01:23PM

21
#42 - せいほう / @FICSQF

03/13/2020 at 02:40AM

21
#43 - Sean Dewar / @seandewar

03/13/2020 at 07:59PM

21
#44 - edvrds / @edvrds

04/18/2020 at 07:49PM

21
#45 - Arthur Goodman / @ArthurGoodman3

04/30/2020 at 07:52PM

21
#46 - Moatvald / @moatvald

05/06/2020 at 08:00AM

21
#47 - 于吉星 / @fishermryn

05/28/2020 at 08:24AM

21
#48 - Kevin Keefe / @KevinKeefe5

06/05/2020 at 04:37PM

21
#49 - Valdimar / @genkobar

06/06/2020 at 04:40PM

21
#50 - samet ぷ / @jssamet

07/04/2020 at 11:00AM

21
#51 - Tiago Nascimento / @tigum27

07/18/2020 at 06:50PM

21
#52 - Tanzeel Kazi / @tanzeelkazi

08/18/2020 at 03:52AM

21
#53 - Blake Tereau / @BlakeTereau

09/11/2020 at 03:15AM

21
#54 - speisz / @speiszc

09/29/2020 at 10:41PM

21
#55 - lamtt77 / @lamtt77

10/11/2020 at 02:39AM

21
#56 - hepebexè / @hepebexe

11/18/2020 at 09:52PM

21
#57 - __VimGolfer__ / @VimGolfer19

11/29/2020 at 03:33PM

21
#58 - roudens / @roudens2

12/27/2020 at 02:31PM

21
#59 - Jung Yeon Park / @park_jungy

01/08/2021 at 01:07AM

21
#60 - Björn Struckmeier / @BjrnStruckmeie1

01/08/2021 at 12:46PM