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 61 remaining solutions by signing in and submitting your own entry
#62 Bradley Cushing / @bradleycushing - Score: 70 - 09/08/19 @ 14:37
:<50-53>:%s/\v(\w+),/\1 = '\U\1',/g<Esc>[201~<Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Left><Right><BS><CR><Esc>:x<CR>

0 comments


Created by: @argshook

62 active golfers, 177 entries

Leaderboard (lowest score wins):
21
#1 - Saki Gw / @Sakigw

09/06/2019 at 01:27PM

21
#2 - Smylers / @Smylers2

09/06/2019 at 02:35PM

21
#3 - Zach Ingbretsen / @ZIngbretsen

09/06/2019 at 03:47PM

21
#4 - Christopher Weyand / @swordman378

09/06/2019 at 04:01PM

21
#5 - John Braxler / @braxler

09/06/2019 at 07:35PM

21
#6 - theBecwar / @thebecwar

09/07/2019 at 01:18PM

21
#7 - Zack Golden / @snedlog

09/07/2019 at 08:13PM

21
#8 - Jon Krause / @jkrause314

09/08/2019 at 05:03PM

21
#9 - Andrzej Wąsowski / @AndrzejWasowski

09/08/2019 at 05:31PM

21
#10 - A / @777Android777

09/08/2019 at 06:47PM

21
#11 - averageRandomPerson / @averageRandomP1

09/08/2019 at 10:00PM

21
#12 - Tosiaki / @Tosiaki1

09/13/2019 at 10:44PM

21
#13 - Josh Cummings / @jcummingsdesign

09/13/2019 at 11:14PM

21
#14 - Cassandra / @kascein

09/17/2019 at 05:31AM

21
#15 - blub / @agorilladriving

09/17/2019 at 01:57PM

21
#16 - Viktor Styrud / @Visklol

09/19/2019 at 08:36AM

22
#17 - Adam Hartz / @awareofnow

09/19/2019 at 02:27AM

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

09/06/2019 at 02:56PM

23
#19 - garry quested / @GQuested

09/09/2019 at 09:12AM

23
#20 - Baine Wedlock / @BaineWedlock

09/11/2019 at 02:07PM

23
#21 - dicekest / @dicekest

09/15/2019 at 04:25AM

23
#22 - vimgolfer / @vimgolfer7

09/20/2019 at 07:33AM

24
#23 - Arijus / @argshook

09/06/2019 at 01:16PM

24
#24 - Norbert / @mullno

09/06/2019 at 03:21PM

24
#25 - Daniel Steinberg / @dstein64

09/06/2019 at 08:49PM

24
#26 - Ivo Blöchliger / @aigledesalpes

09/07/2019 at 01:04PM

24
#27 - tPenguinLTG / @tpenguinltg

09/08/2019 at 03:35AM

24
#28 - Bradley M. Small / @BradleySmall

09/10/2019 at 02:18AM

24
#29 - yesuu / @yesuu15

09/11/2019 at 11:38AM

24
#30 - Ole / @Ole_Lnkoje

09/15/2019 at 04:01PM