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

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

122 active golfers, 649 entries

Solutions by @sap38838304:
15
#24 - sap / @sap38838304

09/16/2022 at 06:18PM

21
#>34 - sap / @sap38838304

09/16/2022 at 06:18PM

22
#>41 - sap / @sap38838304

09/16/2022 at 06:17PM

23
#>45 - sap / @sap38838304

09/16/2022 at 06:16PM

25
#>54 - sap / @sap38838304

09/16/2022 at 06:15PM

27
#>55 - sap / @sap38838304

09/16/2022 at 06:14PM

28
#>57 - sap / @sap38838304

09/16/2022 at 06:13PM

29
#>62 - sap / @sap38838304

09/16/2022 at 06:12PM

30
#>67 - sap / @sap38838304

09/16/2022 at 06:11PM

32
#>68 - sap / @sap38838304

09/16/2022 at 06:10PM

33
#>72 - sap / @sap38838304

09/16/2022 at 06:09PM

35
#>74 - sap / @sap38838304

09/16/2022 at 05:39PM

36
#>77 - sap / @sap38838304

09/16/2022 at 05:34PM

37
#>82 - sap / @sap38838304

09/16/2022 at 05:30PM

38
#>82 - sap / @sap38838304

09/16/2022 at 05:29PM

41
#>86 - sap / @sap38838304

09/16/2022 at 05:28PM