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

Java Array2List

Convert an java array initializer into a list.

Start file
double[] c = 
{
	112.2, 102, 12, 954, 39.43,
	49.4, 2224.6, 94, 123,
	4929.55, 12, 98, 91.22
};
End file
List<Double> c = new ArrayList<Double>();
c.add(112.2);
c.add(102d);
c.add(12d);
c.add(954d);
c.add(39.43);
c.add(49.4);
c.add(2224.6);
c.add(94d);
c.add(123d);
c.add(4929.55);
c.add(12d);
c.add(98d);
c.add(91.22);

View Diff

1,6c1,14
< double[] c = 
< {
< 	112.2, 102, 12, 954, 39.43,
< 	49.4, 2224.6, 94, 123,
< 	4929.55, 12, 98, 91.22
< };
---
> List<Double> c = new ArrayList<Double>();
> c.add(112.2);
> c.add(102d);
> c.add(12d);
> c.add(954d);
> c.add(39.43);
> c.add(49.4);
> c.add(2224.6);
> c.add(94d);
> c.add(123d);
> c.add(4929.55);
> c.add(12d);
> c.add(98d);
> c.add(91.22);

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 79 remaining solutions by signing in and submitting your own entry
#80 basyura / @basyura - Score: 269 - 04/24/11 @ 07:49
ddddddddddddddddddddddddddddddddddList<Double> c = new ArrayList<Double>();<CR>c.add(112.2);<CR>c.add(102d);<CR>c.add(12d);<CR>c.add(954d);<CR>c.add(39.43);<CR>c.add(49.4);<CR>c.add(2224.6);<CR>c.add(94d);<CR>c.add(123d);<CR>c.add(4929.55);<CR>c.add(12d);<CR>c.add(98d);<CR>c.add(91.22);<CR>dd<NL>k<Esc>ddddgggiLi<Esc>:wq<CR>

0 comments


Created by: @robrob12

80 active golfers, 214 entries

Leaderboard (lowest score wins):
119
#61 - Alex Allahverdiev / @alexallah

03/18/2011 at 09:57PM

120
#62 - Jesús Espino / @jespinog

09/05/2011 at 03:09PM

121
#63 - Steve J at RF / @rfsteve

04/11/2011 at 02:03AM

121
#64 - akhilravidas / @akhilravidas

08/19/2011 at 06:08AM

122
#65 - Tomasz Zurkowski / @doriath88

04/07/2011 at 08:45AM

123
#66 - Matthieu Honel / @ocus

02/24/2011 at 01:52PM

126
#67 - michael caviness / @michaelmichael

05/02/2011 at 04:23PM

126
#68 - Piotr Śniegowski / @PiotrSniegowski

06/06/2013 at 01:25PM

133
#69 - Neal Lewis / @neal_lewis

04/02/2011 at 07:20PM

133
#70 - Christian Oudard / @ChristianOudard

04/15/2011 at 03:18PM

136
#71 - funkattack / @funkattack

02/09/2012 at 05:44PM

137
#72 - Fitz / @Fitzface

01/16/2012 at 10:54PM

142
#73 - Pratap Koritala / @pratap_koritala

02/20/2016 at 08:28PM

177
#74 - Matthias Kausl / @sig_segv

04/24/2019 at 07:16PM

184
#75 - ise0615 / @ise0615

05/03/2012 at 07:24AM

185
#76 - Jeff Klein / @ravioli_jazz

08/02/2013 at 08:58AM

205
#77 - Timo / @timoreinhold

12/20/2011 at 10:43AM

223
#78 - Ajay Somani / @ajay_somani

08/19/2011 at 06:07AM

253
#79 - iCross / @iCrossOfficial

04/11/2011 at 08:07AM

269
#80 - basyura / @basyura

04/24/2011 at 07:49AM