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

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

143 active golfers, 748 entries

Solutions by @DzolliH:
15
#12 - Хью Джолли / @DzolliH

06/13/2022 at 07:33AM

15
#>14 - Хью Джолли / @DzolliH

06/20/2022 at 11:45PM

21
#>36 - Хью Джолли / @DzolliH

06/13/2022 at 07:31AM

22
#>45 - Хью Джолли / @DzolliH

06/13/2022 at 07:27AM

23
#>52 - Хью Джолли / @DzolliH

06/13/2022 at 07:25AM

25
#>60 - Хью Джолли / @DzolliH

06/13/2022 at 07:23AM

29
#>67 - Хью Джолли / @DzolliH

06/13/2022 at 07:22AM

30
#>76 - Хью Джолли / @DzolliH

06/13/2022 at 07:21AM

31
#>78 - Хью Джолли / @DzolliH

06/13/2022 at 07:18AM

31
#>78 - Хью Джолли / @DzolliH

06/13/2022 at 07:20AM

39
#>96 - Хью Джолли / @DzolliH

06/13/2022 at 07:16AM

40
#>97 - Хью Джолли / @DzolliH

06/13/2022 at 07:04AM

41
#>99 - Хью Джолли / @DzolliH

06/13/2022 at 07:15AM

44
#>104 - Хью Джолли / @DzolliH

06/13/2022 at 07:01AM

45
#>104 - Хью Джолли / @DzolliH

06/13/2022 at 07:04AM