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

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

221 active golfers, 1315 entries

Solutions by @bpking1:
15
#43 - bpking1 / @bpking1

11/29/2023 at 03:57PM

16
#>61 - bpking1 / @bpking1

11/29/2023 at 03:54PM

18
#>64 - bpking1 / @bpking1

11/29/2023 at 03:54PM

20
#>64 - bpking1 / @bpking1

11/29/2023 at 03:53PM

23
#>87 - bpking1 / @bpking1

11/29/2023 at 03:51PM

24
#>90 - bpking1 / @bpking1

11/29/2023 at 03:45PM

25
#>101 - bpking1 / @bpking1

11/29/2023 at 03:41PM

26
#>102 - bpking1 / @bpking1

11/29/2023 at 03:39PM

28
#>107 - bpking1 / @bpking1

11/29/2023 at 03:36PM

29
#>114 - bpking1 / @bpking1

11/29/2023 at 03:35PM

32
#>122 - bpking1 / @bpking1

11/29/2023 at 03:32PM

37
#>145 - bpking1 / @bpking1

11/29/2023 at 03:27PM

41
#>150 - bpking1 / @bpking1

11/29/2023 at 03:26PM

42
#>154 - bpking1 / @bpking1

11/29/2023 at 03:25PM

51
#>168 - bpking1 / @bpking1

11/29/2023 at 03:24PM

55
#>173 - bpking1 / @bpking1

11/29/2023 at 03:20PM