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

83 active golfers, 456 entries

Leaderboard (lowest score wins):
15
#1 - Jean George / @JeanGeo20504212

05/24/2022 at 01:15PM

15
#2 - Robberechts Arne / @ArneRobberechts

05/24/2022 at 04:11PM

15
#3 - Pablo Cárdenas / @pablo_cardenasb

05/25/2022 at 06:24AM

15
#4 - John Braxler / @braxler

05/27/2022 at 12:11PM

15
#5 - Ekalos / @_Ekalos

05/27/2022 at 01:50PM

15
#6 - Calum Smith / @cpmsmith

05/27/2022 at 10:22PM

15
#7 - mevmev / @mevmev8

05/29/2022 at 06:58PM

15
#8 - jcbglbmn / @JacobGelbman

06/01/2022 at 05:43AM

15
#9 - MortalityCure / @MortalityCure

06/07/2022 at 04:11PM

15
#10 - Brett Bender / @brttbndr

06/11/2022 at 05:28PM

15
#11 - math is what I hate / @mpnmbn

06/12/2022 at 01:22PM

15
#12 - Хью Джолли / @DzolliH

06/13/2022 at 07:33AM

15
#13 - Frankevislav / @frankevislav

06/14/2022 at 01:49AM

15
#14 - Irakli Chigvaria / @tchigvaria

06/15/2022 at 04:02PM

15
#15 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 04:28PM

15
#16 - hamb / @hamb88140219

06/25/2022 at 09:15PM

15
#17 - ATTIA Guillaume / @guillaume_attia

06/25/2022 at 09:15PM

15
#18 - fraktal / @FraktalRebirth

06/25/2022 at 09:17PM

21
#19 - Jon Krause / @jkrause314

05/25/2022 at 03:23AM

21
#20 - Anders Janmyr / @andersjanmyr

05/27/2022 at 09:49AM

21
#21 - Kwizer / @kwizer

05/28/2022 at 11:36AM

21
#22 - Duncan / @Duncan31503119

05/30/2022 at 10:13AM

21
#23 - Arthur Hess / @arthurhess

06/01/2022 at 11:53AM

21
#24 - ShookerAndBeta / @Shooker2012

06/03/2022 at 06:20PM

21
#25 - YE / @DeracanthaOnos

06/16/2022 at 03:37AM

21
#26 - Fabio Murru / @MurruFabio

06/17/2022 at 10:48PM

22
#27 - Smylers / @Smylers2

05/23/2022 at 09:25PM

22
#28 - redbigyesnoGoThenWhy / @redbigyesno

05/28/2022 at 06:40AM

22
#29 - Jan Havránek / @h4vry

05/31/2022 at 11:48PM

22
#30 - Ivo Blöchliger / @aigledesalpes

06/05/2022 at 07:32PM