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 211 remaining solutions by signing in and submitting your own entry
#212 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

212 active golfers, 1274 entries

Leaderboard (lowest score wins):
33
#121 - Alex / @AlexanderHeatl2

05/30/2022 at 08:37PM

33
#122 - reo101 / @reo101gamer

07/08/2022 at 09:21AM

33
#123 - Seungho Lee / @llistnr

03/20/2024 at 05:47AM

34
#124 - Iron Manders / @MandersIron

10/25/2022 at 10:12PM

34
#125 - Gino Fazari / @GinoF

05/15/2023 at 07:13PM

35
#126 - Kyle Channer / @KyleC_Designs

05/24/2022 at 04:04AM

35
#127 - Angela / @Angelakyouko

06/05/2022 at 08:38AM

36
#128 - Driver / @zhouyijiaren

06/10/2022 at 10:08AM

36
#129 - Ariel Frischer / @ArielFrischer

06/27/2022 at 03:48AM

36
#130 - Patrick Motard / @PatrickMotard

08/25/2022 at 05:44AM

36
#131 - e1mnos / @e1mnos

10/24/2022 at 01:06PM

36
#132 - yann / @ylsarto

12/16/2022 at 05:13AM

37
#133 - Derek Schrock / @derekschrock

05/22/2022 at 10:42PM

37
#134 - Taeer Bar-Yam / @sjOrrit

05/26/2022 at 02:26PM

37
#135 - Stupid Five / @TwistedFilter

06/05/2022 at 12:01PM

37
#136 - evertrasjp / @evertrasjp

08/07/2022 at 10:57AM

37
#137 - Elwin Ransom / @jesseleite85

09/06/2022 at 03:13PM

37
#138 - Gs Abl / @gs_abl

11/27/2022 at 09:58AM

37
#139 - Stuart Spinner / @StuartSpinner

12/23/2022 at 01:13PM

37
#140 - Jordan Woods / @JordanW09204552

06/16/2023 at 02:31AM

39
#141 - Samuel McKean / @samuelmckean

06/18/2022 at 02:32PM

40
#142 - gjastrab / @gjastrab

07/08/2022 at 08:48PM

40
#143 - kangrabyg-vim-golf / @kangrabyg

07/29/2022 at 03:10PM

40
#144 - uima / @luck07051

08/21/2023 at 05:17PM

41
#145 - noseskdjs / @nosekxkfkd

06/24/2022 at 07:31AM

42
#146 - George Granberry / @JudgeJerj

07/10/2022 at 07:04PM

42
#147 - Austen Cameron / @austencam

09/05/2022 at 05:23AM

42
#148 - jackson / @bearahuman

04/21/2023 at 03:00PM

42
#149 - ilyas / @Ahaaah2071

09/11/2023 at 03:09PM

43
#150 - Ratkovszki István / @RatkovszkiIstvn

09/04/2022 at 01:42PM