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):
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

67
#4 - Peppa Pig / @PeppaPi95550250

10/12/2024 at 12:18AM

68
#5 - Jean George / @JeanGeo20504212

11/05/2023 at 12:19AM

73
#6 - You-Siang Lin / @yslinnctu

11/29/2011 at 10:09AM

74
#7 - Justin Love / @wondible

09/09/2011 at 02:59PM

76
#8 - Kerson Hsiao / @KersonHsiao

08/04/2012 at 07:28AM

77
#9 - Andrew Dorman / @andydorman

03/23/2011 at 04:10PM

77
#10 - Wei Dai / @clvv42

05/07/2011 at 11:59PM

78
#11 - Tim Chase / @gumnos

02/24/2011 at 03:07PM

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

02/25/2011 at 10:57AM

79
#13 - Nolen Royalty / @NolenRoyalty

04/20/2012 at 01:25PM

80
#14 - Super Garbage / @SuperGarbage0

08/25/2013 at 02:22PM

81
#15 - Johan Sveholm / @rymdtjuren

06/22/2011 at 08:38AM

81
#16 - Partial SHA1 hash / @25fcag9e

06/02/2014 at 11:34AM

83
#17 - Roy Marco Aruta / @royaruta

02/24/2011 at 04:27PM

83
#18 - Steve Morrow / @yawmark

03/01/2011 at 01:58PM

83
#19 - Kevin Hamer / @khamer

03/08/2011 at 11:13PM

83
#20 - Ash Searle / @hexmen

03/09/2011 at 06:22PM

83
#21 - woodythrower / @woodythrower

03/10/2011 at 08:13AM

84
#22 - Pavlo Klets / @p01nt

02/24/2011 at 08:54PM

84
#23 - Arthur Hinh / @arthur_hinh

03/20/2011 at 10:27AM

85
#24 - xhtmlforum / @xhtmlforum

02/24/2011 at 07:57PM

85
#25 - vg / @vimgolfer

02/25/2011 at 02:56AM

85
#26 - William Dunand / @wdunand

02/29/2012 at 06:49AM

85
#27 - Joonas Pihlajamaa / @jokkebk

02/26/2014 at 01:24PM

86
#28 - pftb12345 / @pftb12345

04/07/2015 at 09:21AM

87
#29 - Dave / @zzdave13

07/17/2011 at 02:47PM

88
#30 - Kurt Gaastra / @KGaastra

02/13/2012 at 04:27AM