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 by @mattshen:

Unlock 15 remaining solutions by signing in and submitting your own entry
Created by: @__ngtrongkha

284 active golfers, 1136 entries

Solutions by @mattshen:
20
#110 - Matt Shen / @mattshen

01/23/2024 at 09:27AM

21
#>123 - Matt Shen / @mattshen

01/23/2024 at 09:26AM

22
#>125 - Matt Shen / @mattshen

01/23/2024 at 09:24AM

23
#>131 - Matt Shen / @mattshen

01/23/2024 at 09:21AM

24
#>141 - Matt Shen / @mattshen

01/23/2024 at 09:20AM

26
#>159 - Matt Shen / @mattshen

01/23/2024 at 09:09AM

27
#>165 - Matt Shen / @mattshen

01/23/2024 at 09:06AM

28
#>171 - Matt Shen / @mattshen

01/23/2024 at 08:58AM

29
#>183 - Matt Shen / @mattshen

01/23/2024 at 08:38AM

30
#>191 - Matt Shen / @mattshen

01/23/2024 at 08:36AM

32
#>226 - Matt Shen / @mattshen

01/23/2024 at 08:21AM

35
#>237 - Matt Shen / @mattshen

01/23/2024 at 07:18AM

36
#>242 - Matt Shen / @mattshen

01/23/2024 at 08:13AM

59
#>273 - Matt Shen / @mattshen

01/23/2024 at 07:00AM

64
#>276 - Matt Shen / @mattshen

01/23/2024 at 07:18AM