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 9v00628a9b2f000000000220

Poorly indented Python comments

Fix the alignment of some Python comments as quickly as possible.

Start file
      # Working with enumerations in Python #

from enum import Enum

class Shake(Enum):
    VANILLA = 7
    CHOCOLATE = 4
    COOKIES = 9
    MINT = 3

print(type(Shake.MINT))   #   <enum 'Shake'> 

print(Shake.CHOCOLATE.name)               #    CHOCOLATE
print(Shake.CHOCOLATE.value)                   #     4

print(repr(Shake['COOKIES']))              #  <Shake.COOKIES: 9>

Animal = Enum('Animal', 'ANT BEE CAT DOG')

A = list(Animal); print(A)
# [<Animal.ANT: 1>, <Animal.BEE: 2>, <Animal.CAT: 3>, <Animal.DOG: 4>]
End file
      # Working with enumerations in Python #

from enum import Enum

class Shake(Enum):
    VANILLA = 7
    CHOCOLATE = 4
    COOKIES = 9
    MINT = 3

print(type(Shake.MINT))         # <enum 'Shake'> 

print(Shake.CHOCOLATE.name)     # CHOCOLATE
print(Shake.CHOCOLATE.value)    # 4

print(repr(Shake['COOKIES']))   # <Shake.COOKIES: 9>

Animal = Enum('Animal', 'ANT BEE CAT DOG')

A = list(Animal); print(A)
# [<Animal.ANT: 1>, <Animal.BEE: 2>, <Animal.CAT: 3>, <Animal.DOG: 4>]

View Diff

11c11
< print(type(Shake.MINT))   #   <enum 'Shake'> 
---
> print(type(Shake.MINT))         # <enum 'Shake'> 
13,14c13,14
< print(Shake.CHOCOLATE.name)               #    CHOCOLATE
< print(Shake.CHOCOLATE.value)                   #     4
---
> print(Shake.CHOCOLATE.name)     # CHOCOLATE
> print(Shake.CHOCOLATE.value)    # 4
16c16
< print(repr(Shake['COOKIES']))              #  <Shake.COOKIES: 9>
---
> print(repr(Shake['COOKIES']))   # <Shake.COOKIES: 9>

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 142 remaining solutions by signing in and submitting your own entry
#143 damien / @GreatTestyTest - Score: 199 - 05/27/22 @ 13:24
:11<CR>f$$bbbbbblxxjjkkjjflllll<Esc>hhhh<Esc>vllllllllllllllxjkkjlxxxkjkkhh<Esc>i  <BS><Esc>jjkkl<Esc>ilh<BS><BS><Esc>li        <Esc>jjhhhhhhhi        <Esc>jjkxxxxxxxxxxxxjjxxxxxxxxllxkkxxxxkkkjjjjj:<Esc>kkkkkhhh<Esc>jk<C-V>jjjjjjkxhh<C-Z><C-Z><C-Z><C-Z><C-Z><C-Z><C-Z><Esc><Esc>..<Esc><Esc>jk:w<CR>:q<CR>

0 comments


Created by: @JeanGeo20504212

143 active golfers, 748 entries

Leaderboard (lowest score wins):
25
#61 - Mario / @MarioWolfe

06/15/2022 at 05:28AM

25
#62 - Will Long / @WillLon30283972

06/17/2022 at 03:22AM

25
#63 - -kento / @k_masu

08/30/2022 at 06:52AM

25
#64 - Nathan Iszlaub / @NIszlaub

10/21/2022 at 05:24PM

27
#65 - Aioriya / @AioriyaDonk

08/10/2022 at 06:00PM

28
#66 - Dan Lobser / @sporkl1ft

06/14/2022 at 04:03AM

29
#67 - A White Dwarf / @AWhiteDwarf1

05/31/2022 at 06:32PM

29
#68 - salchint / @salchint

06/19/2022 at 10:05PM

29
#69 - samsepiol / @samsepi81094451

07/08/2022 at 12:51PM

29
#70 - Oli / @o_lalonde

07/10/2022 at 10:12PM

29
#71 - Mika Dede / @xerv0n

09/02/2022 at 04:36AM

29
#72 - Daniel Nägele / @debugloop

09/29/2022 at 06:32AM

29
#73 - bastien batardier / @supercamarche

11/07/2022 at 08:42PM

30
#74 - quemeraisc / @quemeraisc

05/23/2022 at 01:44PM

30
#75 - Enrique Santana / @esantanaya

05/25/2022 at 05:54AM

30
#76 - Leon Si / @leonzalion

06/04/2022 at 07:44PM

30
#77 - Branimir Mirčetić / @BranimirMireti1

07/05/2022 at 11:23AM

30
#78 - freebejan / @freebejan

08/09/2022 at 10:21PM

32
#79 - Elijah Cox / @elikeox

06/16/2022 at 05:41AM

33
#80 - Jakub Parapura / @JakubParapura

05/27/2022 at 01:19PM

33
#81 - x03n046 / @x03n046

05/28/2022 at 04:40AM

33
#82 - Alex / @AlexanderHeatl2

05/30/2022 at 08:37PM

33
#83 - reo101 / @reo101gamer

07/08/2022 at 09:21AM

34
#84 - Iron Manders / @MandersIron

10/25/2022 at 10:12PM

35
#85 - Kyle Channer / @KyleC_Designs

05/24/2022 at 04:04AM

35
#86 - Angela / @Angelakyouko

06/05/2022 at 08:38AM

36
#87 - Driver / @zhouyijiaren

06/10/2022 at 10:08AM

36
#88 - Ariel Frischer / @ArielFrischer

06/27/2022 at 03:48AM

36
#89 - Patrick Motard / @PatrickMotard

08/25/2022 at 05:44AM

36
#90 - e1mnos / @e1mnos

10/24/2022 at 01:06PM