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

78 active golfers, 210 entries

Leaderboard (lowest score wins):
67
#1 - Urtica dioica / @udioica

01/07/2013 at 03:48AM

67
#2 - Petro Тrouq / @zulolosi

07/11/2013 at 02:19AM

67
#3 - John Braxler / @braxler

07/23/2014 at 02:21PM

73
#4 - You-Siang Lin / @yslinnctu

11/29/2011 at 10:09AM

74
#5 - Justin Love / @wondible

09/09/2011 at 02:59PM

76
#6 - Kerson Hsiao / @KersonHsiao

08/04/2012 at 07:28AM

77
#7 - Andrew Dorman / @andydorman

03/23/2011 at 04:10PM

77
#8 - Wei Dai / @clvv42

05/07/2011 at 11:59PM

78
#9 - Tim Chase / @gumnos

02/24/2011 at 03:07PM

78
#10 - h_east (トロッコ6個) / @h_east

02/25/2011 at 10:57AM

79
#11 - Nolen Royalty / @NolenRoyalty

04/20/2012 at 01:25PM

80
#12 - Super Garbage / @SuperGarbage0

08/25/2013 at 02:22PM

81
#13 - Johan Sveholm / @rymdtjuren

06/22/2011 at 08:38AM

81
#14 - Partial SHA1 hash / @25fcag9e

06/02/2014 at 11:34AM

83
#15 - Roy Marco Aruta / @royaruta

02/24/2011 at 04:27PM

83
#16 - Stephen Morrow / @yawmark

03/01/2011 at 01:58PM

83
#17 - Kevin Hamer / @khamer

03/08/2011 at 11:13PM

83
#18 - Ash Searle / @hexmen

03/09/2011 at 06:22PM

83
#19 - woodythrower / @woodythrower

03/10/2011 at 08:13AM

84
#20 - Pavlo Klets / @p01nt

02/24/2011 at 08:54PM

84
#21 - Arthur Hinh / @arthur_hinh

03/20/2011 at 10:27AM

85
#22 - xhtmlforum / @xhtmlforum

02/24/2011 at 07:57PM

85
#23 - vg / @vimgolfer

02/25/2011 at 02:56AM

85
#24 - William Dunand / @wdunand

02/29/2012 at 06:49AM

85
#25 - Joonas Pihlajamaa / @jokkebk

02/26/2014 at 01:24PM

86
#26 - pftb12345 / @pftb12345

04/07/2015 at 09:21AM

87
#27 - Dave / @zzdave13

07/17/2011 at 02:47PM

88
#28 - Kurt Gaastra / @KGaastra

02/13/2012 at 04:27AM

89
#29 - Eivind Jahren / @HaskellElephant

02/24/2011 at 02:14PM

89
#30 - vimja / @vimja666

10/29/2011 at 08:55AM