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

196 active golfers, 1133 entries

Leaderboard (lowest score wins):
36
#121 - yann / @ylsarto

12/16/2022 at 05:13AM

37
#122 - Derek Schrock / @derekschrock

05/22/2022 at 10:42PM

37
#123 - Taeer Bar-Yam / @sjOrrit

05/26/2022 at 02:26PM

37
#124 - Stupid Five / @TwistedFilter

06/05/2022 at 12:01PM

37
#125 - evertrasjp / @evertrasjp

08/07/2022 at 10:57AM

37
#126 - Elwin Ransom / @jesseleite85

09/06/2022 at 03:13PM

37
#127 - Gs Abl / @gs_abl

11/27/2022 at 09:58AM

37
#128 - Stuart Spinner / @StuartSpinner

12/23/2022 at 01:13PM

37
#129 - Jordan Woods / @JordanW09204552

06/16/2023 at 02:31AM

39
#130 - Samuel McKean / @samuelmckean

06/18/2022 at 02:32PM

40
#131 - gjastrab / @gjastrab

07/08/2022 at 08:48PM

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

07/29/2022 at 03:10PM

40
#133 - uima / @luck07051

08/21/2023 at 05:17PM

41
#134 - noseskdjs / @nosekxkfkd

06/24/2022 at 07:31AM

42
#135 - George Granberry / @JudgeJerj

07/10/2022 at 07:04PM

42
#136 - Austen Cameron / @austencam

09/05/2022 at 05:23AM

42
#137 - jackson / @bearahuman

04/21/2023 at 03:00PM

42
#138 - ilyas / @Ahaaah2071

09/11/2023 at 03:09PM

43
#139 - Ratkovszki István / @RatkovszkiIstvn

09/04/2022 at 01:42PM

43
#140 - Jonathan Gin / @jonathangin52

09/30/2022 at 04:15AM

43
#141 - Sergio / @SergioVl12

04/22/2023 at 04:03AM

43
#142 - 야호 / @kse8425z

10/01/2023 at 09:50PM

43
#143 - Matt Shen / @mattshen

01/25/2024 at 05:49AM

44
#144 - Youngchan Lee / @edwardycl

12/15/2022 at 07:47AM

46
#145 - ohwell / @KiranClose

08/08/2022 at 03:29PM

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

09/09/2022 at 02:15AM

47
#147 - tangjm / @tangjm12

09/05/2023 at 08:09AM

50
#148 - 우정민 / @jeongmin2021

10/01/2022 at 09:28AM

51
#149 - D G G / @DGJourneyman

02/20/2023 at 09:16AM

52
#150 - CL / @CL58620058

06/02/2022 at 08:34AM