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

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

221 active golfers, 1315 entries

Solutions by @tchigvaria:
15
#14 - Irakli Chigvaria / @tchigvaria

06/15/2022 at 04:02PM

21
#>69 - Irakli Chigvaria / @tchigvaria

06/15/2022 at 03:59PM

22
#>79 - Irakli Chigvaria / @tchigvaria

06/15/2022 at 03:53PM

23
#>86 - Irakli Chigvaria / @tchigvaria

06/15/2022 at 03:50PM

25
#>98 - Irakli Chigvaria / @tchigvaria

06/15/2022 at 03:47PM

28
#>106 - Irakli Chigvaria / @tchigvaria

06/15/2022 at 03:43PM

29
#>108 - Irakli Chigvaria / @tchigvaria

06/15/2022 at 03:25PM

30
#>117 - Irakli Chigvaria / @tchigvaria

06/15/2022 at 03:19PM

32
#>121 - Irakli Chigvaria / @tchigvaria

06/15/2022 at 03:08PM

46
#>160 - Irakli Chigvaria / @tchigvaria

06/15/2022 at 02:30PM

85
#>199 - Irakli Chigvaria / @tchigvaria

06/15/2022 at 02:21PM