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

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 221 remaining solutions by signing in and submitting your own entry
#222 damien / @GreatTestyTest - Score: 199 - 05/27/22 @ 13:24
:11<CR>f$$bbbbbblxxjjkkjjflllll<Esc>hhhh<Esc>vllllllllllllllxjkkjlxxxkjkkhh<Esc>i  <BS><Esc>jjkkl<Esc>ilh<BS><BS><Esc>li        <Esc>jjhhhhhhhi        <Esc>jjkxxxxxxxxxxxxjjxxxxxxxxllxkkxxxxkkkjjjjj:<Esc>kkkkkhhh<Esc>jk<C-V>jjjjjjkxhh<C-Z><C-Z><C-Z><C-Z><C-Z><C-Z><C-Z><Esc><Esc>..<Esc><Esc>jk:w<CR>:q<CR>

0 comments


Created by: @JeanGeo20504212

222 active golfers, 1316 entries

Leaderboard (lowest score wins):
42
#151 - George Granberry / @JudgeJerj

07/10/2022 at 07:04PM

42
#152 - Austen Cameron / @austencam

09/05/2022 at 05:23AM

42
#153 - jackson / @bearahuman

04/21/2023 at 03:00PM

42
#154 - ilyas / @Ahaaah2071

09/11/2023 at 03:09PM

43
#155 - Ratkovszki István / @RatkovszkiIstvn

09/04/2022 at 01:42PM

43
#156 - Jonathan Gin / @jonathangin52

09/30/2022 at 04:15AM

43
#157 - Sergio / @SergioVl12

04/22/2023 at 04:03AM

43
#158 - 야호 / @kse8425z

10/01/2023 at 09:50PM

43
#159 - Matt Shen / @mattshen

01/25/2024 at 05:49AM

44
#160 - Youngchan Lee / @edwardycl

12/15/2022 at 07:47AM

46
#161 - ohwell / @KiranClose

08/08/2022 at 03:29PM

46
#162 - Leander / @LiLangning

04/06/2024 at 03:25PM

46
#163 - Chris Shorrock / @EbinFlow

06/13/2024 at 02:23PM

47
#164 - 深窓の令嬢@ドクター / @arbino1031

09/09/2022 at 02:15AM

47
#165 - tangjm / @tangjm12

09/05/2023 at 08:09AM

49
#166 - eater.org / @nycksw

04/23/2024 at 01:05PM

50
#167 - 우정민 / @jeongmin2021

10/01/2022 at 09:28AM

51
#168 - D G G / @DGJourneyman

02/20/2023 at 09:16AM

51
#169 - mklug / @mklug

03/25/2025 at 02:11AM

52
#170 - CL / @CL58620058

06/02/2022 at 08:34AM

53
#171 - Zachary Peterson / @zpeterson16

07/24/2022 at 04:11AM

53
#172 - Dr. Peťko / @PetkoDr

09/12/2022 at 08:03AM

54
#173 - Matthew Edge / @edge_hew

02/21/2023 at 06:12AM

54
#174 - Jeff Davis / @_JefeDavis_

03/15/2023 at 06:03PM

56
#175 - Donovan M / @dmille56

04/16/2024 at 06:54AM

57
#176 - Danylo Bodnarchuk / @zairtalk

06/15/2022 at 12:48PM

57
#177 - Aleksandre Khokhiashvili / @skkhokho

07/23/2022 at 10:42AM

57
#178 - Dank City / @ddankcity

12/02/2022 at 03:33PM

58
#179 - Jingshan Yin / @Jingshan1989

07/13/2022 at 08:52PM

58
#180 - OrderObjectOrange / @rderbjectrange

09/06/2022 at 07:33PM