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):
21
#61 - Horst / @Horst91706815

01/21/2021 at 05:32PM

22
#62 - Adam Hartz / @awareofnow

09/19/2019 at 02:27AM

22
#63 - IronTiger Park / @IrontigerP

10/02/2019 at 01:37AM

22
#64 - ErQ325 / @EQ325

10/13/2019 at 10:24AM

22
#65 - Lory / @Lory46845742

10/30/2019 at 02:50PM

22
#66 - trafficone / @trafficone

11/02/2019 at 06:14AM

22
#67 - Chris Covert / @covertcj

11/07/2019 at 08:08PM

22
#68 - Wouter Horlings / @Achilleshiel

11/22/2019 at 04:04PM

22
#69 - Hector Ricardo / @Hector_Ricardo3

12/05/2019 at 04:29PM

22
#70 - Jason Neylon / @jasonneylon

12/19/2019 at 06:41PM

22
#71 - James Casey / @hanavi

12/21/2019 at 02:42AM

22
#72 - Nik C / @nikclarx

01/28/2020 at 04:27AM

22
#73 - countime / @countime1

03/06/2020 at 06:05AM

22
#74 - floyd / @floyd10086

03/09/2020 at 05:30AM

22
#75 - Ryan Nevius / @ryannevius

03/22/2020 at 01:54PM

22
#76 - John Doe / @JohnDoe77150954

03/22/2020 at 05:47PM

22
#77 - RaylanFox / @RaylanFox

04/07/2020 at 05:50PM

22
#78 - GenericHardwareGamer / @GnrikHrdwrGamer

08/27/2020 at 08:25AM

22
#79 - Martin Bielik / @mabielik

09/05/2020 at 08:57PM

22
#80 - chocolate / @chocola81394123

10/28/2020 at 04:15PM

22
#81 - Demian Martinez / @demianuco

12/09/2020 at 09:06PM

22
#82 - Marion Oldman / @ThatBigCock

01/16/2021 at 11:41PM

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

09/06/2019 at 02:56PM

23
#84 - garry quested / @GQuested

09/09/2019 at 09:12AM

23
#85 - Baine Wedlock / @BaineWedlock

09/11/2019 at 02:07PM

23
#86 - dicekest / @dicekest

09/15/2019 at 04:25AM

23
#87 - vimgolfer / @vimgolfer7

09/20/2019 at 07:33AM

23
#88 - Michał Łowicki / @mlowicki

10/12/2019 at 09:59PM

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

10/13/2019 at 07:25PM

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

10/17/2019 at 07:24PM