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

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

143 active golfers, 748 entries

Solutions by @MortalityCure:
15
#9 - MortalityCure / @MortalityCure

06/07/2022 at 04:11PM

21
#>36 - MortalityCure / @MortalityCure

06/07/2022 at 04:04PM

22
#>45 - MortalityCure / @MortalityCure

06/07/2022 at 04:01PM

23
#>51 - MortalityCure / @MortalityCure

06/07/2022 at 03:59PM

25
#>60 - MortalityCure / @MortalityCure

06/07/2022 at 03:57PM

29
#>67 - MortalityCure / @MortalityCure

06/07/2022 at 03:54PM

31
#>78 - MortalityCure / @MortalityCure

06/07/2022 at 03:52PM

34
#>83 - MortalityCure / @MortalityCure

06/07/2022 at 03:47PM

36
#>86 - MortalityCure / @MortalityCure

06/07/2022 at 03:38PM

38
#>96 - MortalityCure / @MortalityCure

06/07/2022 at 03:34PM

41
#>99 - MortalityCure / @MortalityCure

06/07/2022 at 03:31PM

43
#>102 - MortalityCure / @MortalityCure

06/07/2022 at 03:30PM

45
#>104 - MortalityCure / @MortalityCure

06/07/2022 at 03:28PM

49
#>106 - MortalityCure / @MortalityCure

06/07/2022 at 03:25PM