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):
92
#31 - Asmund / @herrasbe

02/04/2013 at 06:28PM

93
#32 - Oleg Pestov / @opestov

03/09/2011 at 05:56PM

94
#33 - xaizek / @xaizek

02/26/2011 at 02:50PM

94
#34 - Hu Junfeng / @junfeng

08/02/2011 at 11:54AM

94
#35 - Renat Aksitov / @Korvin79

01/29/2012 at 08:44PM

94
#36 - Justin / @justinjaffray

05/04/2013 at 08:20PM

95
#37 - 無ん垢の叫び / @john_ababa

02/27/2012 at 11:43AM

97
#38 - Pete Johns / @johnsyweb

03/14/2011 at 04:31AM

99
#39 - Aaron Miller / @apage43

08/14/2012 at 08:37AM

100
#40 - Øystein Walle / @oysteinwalle

07/06/2011 at 02:39PM

101
#41 - Jason Axelson / @bostonvaulter

05/10/2011 at 06:13PM

103
#42 - icdark / @icdark

05/30/2011 at 10:48AM

103
#43 - Mohammed / @mbadran

09/04/2011 at 09:34AM

105
#44 - Peter Anselmo / @peter_anselmo

06/23/2011 at 08:31PM

105
#45 - Tesnorth / @Tesnorth

01/31/2012 at 03:40PM

105
#46 - blamitter ✏️ / @blamitter

02/18/2012 at 08:38PM

105
#47 - James / @Dronak

09/20/2014 at 06:59PM

107
#48 - timhoa / @timhoa

02/26/2011 at 11:58AM

107
#49 - Trevor Powell / @DoomedBunnies

03/20/2013 at 01:09AM

110
#50 - Bailey Ling / @blingcoder

01/26/2013 at 08:07PM

111
#51 - Joost / @vlabakje

03/02/2011 at 08:28PM

111
#52 - Dimitar Dimitrov / @kurkale6ka

09/16/2016 at 04:38PM

112
#53 - Chun Yang / @cccyang

07/27/2012 at 09:13AM

112
#54 - Yann Moisan / @YannMoisan

01/13/2013 at 08:26PM

115
#55 - Simon's Calf / @simonscarfe

09/06/2011 at 12:32PM

115
#56 - Paul Inc / @hiniol1982

02/24/2019 at 08:30PM

117
#57 - Thom Hughes / @thom_hughes_1

03/26/2011 at 12:24AM

118
#58 - Dmitry Teslenko / @krab_mozga

02/25/2011 at 12:08PM

118
#59 - Dmitry Bashkatov / @dbashkatov

10/31/2011 at 11:05AM

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

02/24/2011 at 02:21PM