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 86 remaining solutions by signing in and submitting your own entry
#87 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

87 active golfers, 233 entries

Leaderboard (lowest score wins):
115
#61 - Paul Inc / @hiniol1982

02/24/2019 at 08:30PM

117
#62 - Thom Hughes / @thom_hughes_1

03/26/2011 at 12:24AM

118
#63 - Dmitry Teslenko / @krab_mozga

02/25/2011 at 12:08PM

118
#64 - Dmitry Bashkatov / @dbashkatov

10/31/2011 at 11:05AM

119
#65 - Dezső Zoltán / @zakiazigazi

02/24/2011 at 02:21PM

119
#66 - Alex Allahverdiev / @alexallah

03/18/2011 at 09:57PM

120
#67 - Jesús Espino / @jespinog

09/05/2011 at 03:09PM

121
#68 - Steve J at RF / @rfsteve

04/11/2011 at 02:03AM

121
#69 - akhilravidas / @akhilravidas

08/19/2011 at 06:08AM

122
#70 - Tomasz Zurkowski / @doriath88

04/07/2011 at 08:45AM

123
#71 - Matthieu Honel / @ocus

02/24/2011 at 01:52PM

126
#72 - michael caviness / @michaelmichael

05/02/2011 at 04:23PM

126
#73 - Piotr Śniegowski / @PiotrSniegowski

06/06/2013 at 01:25PM

132
#74 - RockerZZY / @rocker_zzy

06/04/2020 at 02:09PM

133
#75 - Neal Lewis / @neal_lewis

04/02/2011 at 07:20PM

133
#76 - Christian Oudard / @ChristianOudard

04/15/2011 at 03:18PM

136
#77 - funkattack / @funkattack

02/09/2012 at 05:44PM

137
#78 - Fitz / @Fitzface

01/16/2012 at 10:54PM

142
#79 - Pratap Koritala / @pratap_koritala

02/20/2016 at 08:28PM

177
#80 - Matthias Kausl / @sig_segv

04/24/2019 at 07:16PM

184
#81 - ise0615 / @ise0615

05/03/2012 at 07:24AM

185
#82 - Jeff Klein / @ravioli_jazz

08/02/2013 at 08:58AM

185
#83 - nickGPT / @nickandbro

08/28/2024 at 10:55PM

205
#84 - Timo / @timoreinhold

12/20/2011 at 10:43AM

223
#85 - Ajay Somani / @ajay_somani

08/19/2011 at 06:07AM

253
#86 - iCross / @iCrossOfficial

04/11/2011 at 08:07AM

269
#87 - basyura / @basyura

04/24/2011 at 07:49AM