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

181 active golfers, 632 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

22
#51 - Adam Hartz / @awareofnow

09/19/2019 at 02:27AM

22
#52 - IronTiger Park / @IrontigerP

10/02/2019 at 01:37AM

22
#53 - ErQ325 / @EQ325

10/13/2019 at 10:24AM

22
#54 - Lory / @Lory46845742

10/30/2019 at 02:50PM

22
#55 - trafficone / @trafficone

11/02/2019 at 06:14AM

22
#56 - Chris Covert / @covertcj

11/07/2019 at 08:08PM

22
#57 - Wouter Horlings / @Achilleshiel

11/22/2019 at 04:04PM

22
#58 - Hector Ricardo / @Hector_Ricardo3

12/05/2019 at 04:29PM

22
#59 - Jason Neylon / @jasonneylon

12/19/2019 at 06:41PM

22
#60 - James Casey / @hanavi

12/21/2019 at 02:42AM