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

197 active golfers, 675 entries

Leaderboard (lowest score wins):
27
#151 - vito / @vito49999722

08/17/2020 at 07:41PM

28
#152 - Walker Boh / @walker_boh

09/06/2019 at 01:21PM

28
#153 - Floyd Gantt / @fgantt

09/06/2019 at 01:30PM

28
#154 - bsjd / @bsjd

09/10/2019 at 12:14PM

28
#155 - Jonathan Eidsness / @jonathaneidsnes

09/12/2019 at 07:49PM

28
#156 - Jason Birchall / @jsonBirchall

09/13/2019 at 08:50AM

28
#157 - Ariel Miculas / @ArielMiculas

09/18/2019 at 02:58PM

28
#158 - phe / @phelipetls

09/22/2019 at 02:12PM

28
#159 - Daniel Rollins / @DanielJRollins

10/25/2019 at 02:18PM

28
#160 - rr / @rodgeur31

10/25/2019 at 10:43PM

28
#161 - Alex Emelianov / @AlexEmelianov3

10/26/2019 at 12:54AM

28
#162 - Yasky / @Yaasky

11/01/2019 at 05:18PM

28
#163 - damien / @GreatTestyTest

11/10/2019 at 10:54PM

28
#164 - glopz / @gl0pz

12/08/2019 at 09:14PM

28
#165 - Isaak Meier / @IsaakMeier

12/12/2019 at 03:16AM

28
#166 - beew71493 / @beew71493

01/27/2020 at 05:36AM

28
#167 - Falafel Palapel / @falafelpalapel

02/16/2020 at 06:02PM

28
#168 - Mack Hutsell / @sellshuts

06/15/2020 at 01:31AM

28
#169 - dotvimrc / @dotvimrc1

07/07/2020 at 06:44AM

28
#170 - Kaustubh Murumkar / @k_austub_h

08/31/2020 at 08:14PM

29
#171 - greengreen / @greengr09073862

09/06/2019 at 04:58PM

29
#172 - Abner jr / @Abnerjr19

09/09/2019 at 02:55AM

29
#173 - Jose Soto / @JoseCanHelp

09/10/2019 at 03:30AM

29
#174 - Benjamin Pelletier / @benjipelletier

09/25/2019 at 08:45PM

29
#175 - Jonathan Medwig / @jmedwig

10/15/2019 at 02:32PM

29
#176 - Emil Braserud / @Erdustiggen

11/08/2019 at 05:21PM

29
#177 - majo senf / @majo_senf

07/14/2020 at 08:58AM

29
#178 - Theo Sarrazin / @tshaero

08/18/2020 at 02:00PM

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

09/08/2019 at 03:35AM

30
#180 - Iggy / @iggredible

09/10/2019 at 03:48AM