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

206 active golfers, 1217 entries

Leaderboard (lowest score wins):
15
#31 - Ivan Trepakov / @liontiger23

12/30/2022 at 03:59PM

15
#32 - e_e / @eleloi

02/09/2023 at 10:34PM

15
#33 - Ringel Natter / @SenorTenor

02/10/2023 at 10:07AM

15
#34 - owner / @owner87643936

04/24/2023 at 06:49PM

15
#35 - Игорь Квачёнок / @IKvacenok

06/11/2023 at 06:42PM

15
#36 - dew mtn / @dewmtn2

07/30/2023 at 03:37AM

15
#37 - moh ayaya / @AyayaMoh

08/18/2023 at 08:16PM

15
#38 - Monkey Boy / @monkey29089

09/23/2023 at 04:38AM

15
#39 - Laurens De la Marche / @LaurensDLM

10/17/2023 at 01:52PM

15
#40 - Luoyb / @Luoyb

10/21/2023 at 02:46AM

15
#41 - tien / @tien40766111

11/09/2023 at 10:52AM

15
#42 - FilipRazek / @FilipRazek

11/11/2023 at 10:06AM

15
#43 - bpking1 / @bpking1

11/29/2023 at 03:57PM

15
#44 - Remus Dalrymple / @bornintheflames

12/11/2023 at 11:52PM

15
#45 - Leon Katsnelson / @leonkatsnelson

12/14/2023 at 07:21PM

15
#46 - Anaritus / @Anaritus

02/24/2024 at 10:18AM

15
#47 - Lennart / @lennartack

04/21/2024 at 12:23PM

15
#48 - bonettimrc / @bonettimrc

04/27/2024 at 10:04PM

15
#49 - d-ornen / @d-ornen

05/05/2024 at 03:04PM

16
#50 - 蛙爹 / @Joe53572723

02/19/2023 at 08:35AM

16
#51 - Иван / @wansmer

04/22/2023 at 07:47PM

16
#52 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 05:02PM

16
#53 - ShookerAndBeta / @Shooker2012

07/08/2023 at 03:58AM

16
#54 - naka / @nak38223985244

08/21/2023 at 01:16PM

16
#55 - Francois Marais / @maraisf

10/13/2023 at 06:00PM

16
#56 - anythingapplied / @anythingapplied

02/02/2024 at 04:56AM

17
#57 - Luke Korn / @LukeKorn

10/06/2022 at 12:43PM

21
#58 - Jon Krause / @jkrause314

05/25/2022 at 03:23AM

21
#59 - Anders Janmyr / @andersjanmyr

05/27/2022 at 09:49AM

21
#60 - Kwizer / @kwizer

05/28/2022 at 11:36AM