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 6013804df3308e0009368f1c

Python dataclasses

Simple challenge to extract fields from a Python class

Start file
from dataclasses import dataclass

@dataclass
class Student:
    student_id: str
    name: str
    age: int 
    score: float

fields = ""

End file
from dataclasses import dataclass

@dataclass
class Student:
    student_id: str
    name: str
    age: int 
    score: float

fields = "student_id,name,age,score"

View Diff

10c10
< fields = ""
---
> fields = "student_id,name,age,score"

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 229 remaining solutions by signing in and submitting your own entry
#230 Kenneth Hyman / @kjhyman - Score: 107 - 04/27/21 @ 14:12
jjjjebveyjjjjejekeeei<Esc>pkkkkbbbveduveyjjjeeeeebea,<Esc>pkkkbbbveduveyjjjeeeeeea,<Esc>p<Esc>kkbbbveyjjeeeeeeeea,<Esc>p:w<CR>:wq<CR>

0 comments


Created by: @__ngtrongkha

230 active golfers, 882 entries

Leaderboard (lowest score wins):
26
#121 - Richy Strnad / @RichardStrnad

03/21/2022 at 06:13AM

26
#122 - vimgolfaccfekxh / @vimgolfaccfekxh

10/30/2022 at 01:25PM

27
#123 - Jan / @Howi48

04/08/2021 at 02:13PM

27
#124 - Vgrbwat / @vgrbwat

06/11/2021 at 06:58PM

27
#125 - Tommy / @Tommy75962547

08/24/2021 at 06:21AM

27
#126 - Isaak Meier / @IsaakMeier

10/06/2021 at 08:08PM

27
#127 - Brandon / @Brandon10678836

08/29/2022 at 12:12PM

27
#128 - Vincent Lai / @walilav

10/20/2023 at 08:37AM

28
#129 - Gerrit Prößl / @pearisgreen

11/27/2021 at 05:23PM

28
#130 - ココアサ / @zAxLcKjTWc6aP6P

12/04/2021 at 02:58AM

28
#131 - 박덕구 / @bagdeoggu

12/05/2021 at 07:13AM

28
#132 - leo / @leo848b

09/14/2022 at 05:33PM

29
#133 - asdgfwaefewf123123 / @asdgfwaefewf121

03/17/2021 at 02:34PM

29
#134 - Lucas / @Lucas90143719

04/18/2021 at 04:10AM

29
#135 - Antoine Hachez / @Antoine_Hachez

05/16/2021 at 10:58AM

29
#136 - damned-me / @damned_me_

05/24/2021 at 04:48PM

29
#137 - noname / @1____NULL____0

07/12/2021 at 01:57PM

29
#138 - tpoeiras / @tpoeirass

08/01/2021 at 02:49AM

29
#139 - sydman / @sydman11

11/18/2021 at 08:59AM

29
#140 - Chun Chanjun / @CChanjun

11/19/2021 at 03:10PM

29
#141 - 박기창 / @baggichang3

12/02/2021 at 01:50PM

29
#142 - math is what I hate / @mpnmbn

06/12/2022 at 02:26PM

29
#143 - Jakob Weickmann / @jweickm

11/14/2023 at 03:06PM

30
#144 - Ceda EI / @ceda_ei

01/29/2021 at 06:49AM

30
#145 - simplelife2010 / @simplelife20101

05/13/2021 at 01:15PM

30
#146 - Calarasanu Andrei / @_fanfani4_

05/24/2021 at 07:15AM

30
#147 - Léo / @Leo58369183

08/24/2022 at 08:14AM

30
#148 - 0xf00ff00f / @0xf00ff00f

12/04/2022 at 11:30PM

30
#149 - kunsttyv / @kunsttyv

12/21/2022 at 08:37PM

30
#150 - Ludovic Schwartz / @ludovicschwartz

11/20/2023 at 01:57PM