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 @brttbndr:

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

143 active golfers, 748 entries

Solutions by @brttbndr:
15
#10 - Brett Bender / @brttbndr

06/11/2022 at 05:28PM

15
#>10 - Brett Bender / @brttbndr

06/11/2022 at 05:36PM

15
#>10 - Brett Bender / @brttbndr

06/11/2022 at 05:37PM

21
#>36 - Brett Bender / @brttbndr

06/11/2022 at 05:27PM

22
#>45 - Brett Bender / @brttbndr

06/11/2022 at 05:26PM

23
#>52 - Brett Bender / @brttbndr

06/11/2022 at 05:23PM

25
#>60 - Brett Bender / @brttbndr

06/11/2022 at 05:22PM

29
#>67 - Brett Bender / @brttbndr

06/11/2022 at 05:20PM

30
#>76 - Brett Bender / @brttbndr

06/11/2022 at 05:19PM

31
#>78 - Brett Bender / @brttbndr

06/11/2022 at 05:18PM

32
#>78 - Brett Bender / @brttbndr

06/11/2022 at 05:16PM

39
#>96 - Brett Bender / @brttbndr

06/11/2022 at 05:09PM

42
#>100 - Brett Bender / @brttbndr

06/11/2022 at 05:07PM