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 4d1ed78425ba287b2a000227

CSV to JSON

A search for shortest vimissh way to convert CSV to JSON.

Start file
Year,Make,Model,Length
1997,Ford,E350,2.34
2000,Mercury,Cougar,2.38
End file
[
	{
		"Year": "1997",
		"Make": "Ford",
		"Model": "E350",
		"Length": "2.34"
	},
	{
		"Year": "2000",
		"Make": "Mercury",
		"Model": "Cougar",
		"Length": "2.38"
	}
]

View Diff

1,3c1,14
< Year,Make,Model,Length
< 1997,Ford,E350,2.34
< 2000,Mercury,Cougar,2.38
---
> [
> 	{
> 		"Year": "1997",
> 		"Make": "Ford",
> 		"Model": "E350",
> 		"Length": "2.34"
> 	},
> 	{
> 		"Year": "2000",
> 		"Make": "Mercury",
> 		"Model": "Cougar",
> 		"Length": "2.38"
> 	}
> ]

Solutions by @cipmar:

Unlock 9 remaining solutions by signing in and submitting your own entry
Created by: @Ujjwol

66 active golfers, 173 entries

Solutions by @cipmar:
194
#61 - Marius Ropotica / @cipmar

03/30/2024 at 06:10PM

200
#>61 - Marius Ropotica / @cipmar

03/30/2024 at 06:03PM

214
#>63 - Marius Ropotica / @cipmar

03/30/2024 at 05:33PM

214
#>63 - Marius Ropotica / @cipmar

03/30/2024 at 05:59PM

265
#>64 - Marius Ropotica / @cipmar

03/30/2024 at 05:28PM

357
#>65 - Marius Ropotica / @cipmar

03/30/2024 at 03:27PM

371
#>65 - Marius Ropotica / @cipmar

03/30/2024 at 05:15PM

372
#>65 - Marius Ropotica / @cipmar

03/30/2024 at 03:35PM

439
#>66 - Marius Ropotica / @cipmar

03/30/2024 at 03:22PM