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

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

221 active golfers, 1315 entries

Solutions by @SenorTenor:
15
#33 - Ringel Natter / @SenorTenor

02/10/2023 at 10:07AM

16
#>55 - Ringel Natter / @SenorTenor

02/10/2023 at 09:19AM

20
#>64 - Ringel Natter / @SenorTenor

02/10/2023 at 09:09AM

22
#>82 - Ringel Natter / @SenorTenor

02/10/2023 at 09:05AM

23
#>87 - Ringel Natter / @SenorTenor

02/10/2023 at 09:00AM

24
#>89 - Ringel Natter / @SenorTenor

02/10/2023 at 07:15AM

25
#>101 - Ringel Natter / @SenorTenor

02/10/2023 at 07:12AM

26
#>101 - Ringel Natter / @SenorTenor

02/09/2023 at 11:13PM

28
#>106 - Ringel Natter / @SenorTenor

02/09/2023 at 11:08PM

30
#>119 - Ringel Natter / @SenorTenor

02/09/2023 at 10:53PM

36
#>137 - Ringel Natter / @SenorTenor

02/09/2023 at 10:38PM

37
#>144 - Ringel Natter / @SenorTenor

02/09/2023 at 06:47PM

44
#>160 - Ringel Natter / @SenorTenor

02/09/2023 at 04:03PM

45
#>160 - Ringel Natter / @SenorTenor

02/09/2023 at 03:33PM

49
#>165 - Ringel Natter / @SenorTenor

02/09/2023 at 03:12PM

52
#>169 - Ringel Natter / @SenorTenor

02/09/2023 at 03:02PM

53
#>171 - Ringel Natter / @SenorTenor

02/09/2023 at 12:23PM