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

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 65 remaining solutions by signing in and submitting your own entry
#66 ise0615 / @ise0615 - Score: 395 - 05/13/12 @ 07:35
i"<Esc>wwi"<Right><CR>"<Esc>ww.ui"<Right><CR><Esc>.ui"<Esc>wwi"<Right><CR><Esc>.ui"<Esc>wwkwwblllllla"<CR><Esc>jkkkkkkkk$a<BS>:<Down><BS>:<Down><Right><BS>:<Down><Right>:<Esc>jkkkkkk0i[<CR>{<CR><Esc>jjjji},<CR><Esc>kkkkkkvjjjjjlljkhhyjjjjjpi,<CR><Esc>jjjjjlxji]<Esc>jv$dkkkkkkkkkkkk$pi <Esc>wwlv$djla <Esc>plllllv$djla <Esc>pllllv<Esc>lDjja<Esc>phhhi <Esc>kddjjjjjjjjjjjddkkkkk$pi<BS> <Esc>llllllDjla <Esc>pbbbbbv$duv$hdjla <Esc>pbhbv$duv$hdjla <Esc>pa"<Esc>hhhh.ub.u<Left><Left>.<Up><Left><Left>.<Up><Left><Left>.<Up><Left>.<Right><Right><Right><Right>.<Down><Right><Right>.<Down><Left>.<Up><Up><Up><Up><Up>.<Up><Left>.<Up><Left>.<Up><Left>.<Left><Left><Left><Left><Left>.<Down><Left>.<Down><Left><Right>.<Down><Right><Left>.<Esc>0kkkk<C-V>jjjjj>jl<C-V>jjjjk>jjjjj<C-V>jjjjj>jl<C-V>jjj>ZZ

0 comments


Created by: @Ujjwol

66 active golfers, 173 entries

Leaderboard (lowest score wins):
194
#61 - Marius Ropotica / @cipmar

03/30/2024 at 06:10PM

204
#62 - Christopher Sexton / @crsexton

01/01/2011 at 08:08PM

210
#63 - Ilya Ermolin / @ermolinis

01/01/2011 at 07:25PM

231
#64 - Mitch LeBlanc / @symmitchry

10/22/2014 at 05:20AM

272
#65 - Dan Williams / @deft_of_center

04/03/2013 at 04:02AM

395
#66 - ise0615 / @ise0615

05/13/2012 at 07:35AM