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):
24
#31 - Andrey / @andreyrmg

09/16/2019 at 02:46PM

24
#32 - Ollin Boer Bohan / @madebyollin

09/22/2019 at 03:50PM

25
#33 - Bennett / @bennettbackward

09/11/2019 at 09:56AM

25
#34 - arsi arola / @mos_kiitto

09/13/2019 at 08:23PM

26
#35 - Alexander L. / @Lexol4s

09/16/2019 at 10:20PM

26
#36 - ollir / @ollir19

09/17/2019 at 07:43PM

26
#37 - Jonathan Lozinski / @jlozinski

09/20/2019 at 12:45PM

27
#38 - Charlie OConor / @charlieoconor

09/06/2019 at 05:34PM

27
#39 - Daniel Beck / @daniel_beck_il

09/09/2019 at 04:09PM

27
#40 - louis / @LouisJordan

09/10/2019 at 07:58AM

27
#41 - vim_ninja / @NinjaVim

09/14/2019 at 09:28PM

28
#42 - Walker Boh / @walker_boh

09/06/2019 at 01:21PM

28
#43 - Floyd Gantt / @fgantt

09/06/2019 at 01:30PM

28
#44 - bsjd / @bsjd

09/10/2019 at 12:14PM

28
#45 - Jonathan Eidsness / @jonathaneidsnes

09/12/2019 at 07:49PM

28
#46 - Jason Birchall / @jsonBirchall

09/13/2019 at 08:50AM

28
#47 - Ariel Miculas / @ArielMiculas

09/18/2019 at 02:58PM

28
#48 - phe / @phelipetls

09/22/2019 at 02:12PM

29
#49 - greengreen / @greengr09073862

09/06/2019 at 04:58PM

29
#50 - Abner jr / @Abnerjr19

09/09/2019 at 02:55AM

29
#51 - Jose Soto / @JoseCanHelp

09/10/2019 at 03:30AM

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

09/08/2019 at 03:35AM

30
#53 - Iggy / @iggredible

09/10/2019 at 03:48AM

32
#54 - Raphael Marra / @rtmarra

09/06/2019 at 08:38PM

32
#55 - Ralph Callaway / @RalphAtCCC

09/13/2019 at 09:03AM

32
#56 - Khamnhoui-Boulom / @k_nhoui

09/16/2019 at 11:47AM

32
#57 - EL KESRI Othmane / @KesriOthmane

09/16/2019 at 01:35PM

35
#58 - asfsef / @asfsef5

09/12/2019 at 01:50AM

35
#59 - Alex Bartol / @alexbartol

09/13/2019 at 12:24AM

38
#60 - Alexey Kuntsevich / @jezzarax

09/09/2019 at 09:59AM