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 by @eleloi:

Unlock 16 remaining solutions by signing in and submitting your own entry
Created by: @JeanGeo20504212

221 active golfers, 1315 entries

Solutions by @eleloi:
15
#32 - e_e / @eleloi

02/09/2023 at 10:34PM

17
#>64 - e_e / @eleloi

02/09/2023 at 10:33PM

21
#>74 - e_e / @eleloi

02/09/2023 at 10:32PM

22
#>82 - e_e / @eleloi

02/09/2023 at 10:29PM

22
#>82 - e_e / @eleloi

02/09/2023 at 10:30PM

28
#>106 - e_e / @eleloi

02/09/2023 at 10:27PM

29
#>114 - e_e / @eleloi

02/09/2023 at 10:26PM

30
#>119 - e_e / @eleloi

02/09/2023 at 10:25PM

31
#>121 - e_e / @eleloi

02/09/2023 at 10:24PM

34
#>128 - e_e / @eleloi

02/09/2023 at 10:22PM

35
#>131 - e_e / @eleloi

02/09/2023 at 10:20PM

37
#>144 - e_e / @eleloi

02/09/2023 at 10:18PM

38
#>145 - e_e / @eleloi

02/09/2023 at 10:14PM

49
#>165 - e_e / @eleloi

02/09/2023 at 10:05PM

58
#>179 - e_e / @eleloi

02/09/2023 at 10:09PM

77
#>193 - e_e / @eleloi

02/09/2023 at 10:01PM