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):
89
#31 - Eivind Jahren / @HaskellElephant

02/24/2011 at 02:14PM

89
#32 - vimja / @vimja666

10/29/2011 at 08:55AM

92
#33 - Asmund / @herrasbe

02/04/2013 at 06:28PM

93
#34 - Oleg Pestov / @opestov

03/09/2011 at 05:56PM

94
#35 - xaizek / @xaizek

02/26/2011 at 02:50PM

94
#36 - Junfeng / @junfeng

08/02/2011 at 11:54AM

94
#37 - Renat Aksitov / @Korvin79

01/29/2012 at 08:44PM

94
#38 - Justin / @justinjaffray

05/04/2013 at 08:20PM

95
#39 - じょんあば / @john_ababa

02/27/2012 at 11:43AM

97
#40 - Pete Johns / @johnsyweb

03/14/2011 at 04:31AM

99
#41 - Aaron Miller / @apage43

08/14/2012 at 08:37AM

100
#42 - Øystein Walle / @oysteinwalle

07/06/2011 at 02:39PM

100
#43 - shahanavaz m / @shahanavazm

02/06/2024 at 07:44PM

101
#44 - Jason Axelson / @bostonvaulter

05/10/2011 at 06:13PM

103
#45 - icdark / @icdark

05/30/2011 at 10:48AM

103
#46 - Mohammed / @mbadran

09/04/2011 at 09:34AM

105
#47 - Peter Anselmo / @peter_anselmo

06/23/2011 at 08:31PM

105
#48 - Tesnorth / @Tesnorth

01/31/2012 at 03:40PM

105
#49 - blamitter ✏️ / @blamitter

02/18/2012 at 08:38PM

105
#50 - James / @Dronak

09/20/2014 at 06:59PM

107
#51 - timhoa / @timhoa

02/26/2011 at 11:58AM

107
#52 - Trevor Powell / @DoomedBunnies

03/20/2013 at 01:09AM

110
#53 - Bailey Ling / @blingcoder

01/26/2013 at 08:07PM

110
#54 - KoroneListener / @KoroneListener

09/04/2024 at 11:19AM

111
#55 - Joost / @vlabakje

03/02/2011 at 08:28PM

111
#56 - Dimitar Dimitrov / @kurkale6ka

09/16/2016 at 04:38PM

112
#57 - Chun Yang / @cccyang

07/27/2012 at 09:13AM

112
#58 - Yann Moisan / @YannMoisan

01/13/2013 at 08:26PM

113
#59 - Alexandre GV. / @alexandregv

07/13/2024 at 12:16AM

115
#60 - Simon Scarfe / @simonscarfe

09/06/2011 at 12:32PM