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 542eff6588fc4d00021aa9cd

Refactor static member invocation

Someone used a static method. Refactor the method into a static import while fixing the assertion.

Start file
import org.Assert;

C{
	m(){
		Assert.assertEquals(42, "Meaning of life");
	}
}
End file
import static org.Assert.assertEquals;

C{
	m(){
		assertEquals("Meaning of life", "Meaning of life");
	}
}

View Diff

1c1
< import org.Assert;
---
> import static org.Assert.assertEquals;
5c5
< 		Assert.assertEquals(42, "Meaning of life");
---
> 		assertEquals("Meaning of life", "Meaning of life");

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 40 remaining solutions by signing in and submitting your own entry
#41 takashi / k_takashi0309 - Score: 40 - 10/08/14 @ 13:41
wistatic <Esc>f;i.<C-N><C-N><Esc>4j^dw.f4cf2"<C-N> o<C-N> l<C-N>"<Esc>ZZ

0 comments

#42 SilentFl / Silent_Fl - Score: 41 - 01/27/15 @ 13:26
/4<CR>df yf"Pa, <Esc>^2dwywggwistatic <Esc>$Pui.<Esc>pZZ

0 comments

#43 Gerald Tilma / GeraldTilma - Score: 41 - 10/22/15 @ 02:52
wistatic <Esc>3ea.<Esc>4jhdb.yw4k$P4jbbyf"bbvlpZZ

0 comments

#44 James / Dronak - Score: 43 - 10/03/14 @ 22:31
4+dwxyw4ka.<C-R>"<Esc>Bistatic <Esc>/4<CR>dt"yt)$hi, <C-R>"<Esc>ZZ

Dronak: I thought this was good, but clearly I don't know the trick to getting a really good score. :\

1 comment

#45 Nate Eagleson / NateEag - Score: 43 - 10/05/14 @ 01:18
ea static<Esc>/4<CR>dwf"yf"bp?A<CR>d2wyt(?;<CR>ha.<Esc>p:wq<CR>

0 comments

#46 ɐʇnɥsɐpoʇ / todashuta - Score: 43 - 03/26/15 @ 07:32
f i static<C-O>f;.as<C-P><C-P><Esc>/A<CR>df.f4dt"ya"f)i, <C-R>"<Esc>ZZ

0 comments

#47 Jakob / jajob - Score: 49 - 10/06/14 @ 17:53
ea static<Esc>fAyW~hPeaEquals<Esc>F;r.5Gf"yf"F4Plxx^df.ZZ

0 comments

#48 Narek / NarekCat - Score: 49 - 10/10/14 @ 19:18
wistatic <Esc>jjjjldf.f4xxwvf"yF,PBBBvf(hygg$i.<Esc>PupZZ

0 comments

#49 RobertT / techrt2050 - Score: 54 - 10/05/14 @ 04:25
wistatic <Esc>3Lwyt(H$P3Ldf.f4cw"m<BS>Meaning of life'<BS>"<Esc>:wq<CR>

0 comments

#50 LSMTD / LSMTD - Score: 62 - 12/09/14 @ 03:39
wistti<BS><BS>atic <Esc>$i.assertEquals<Esc>5Gdf.f(lcw"Meaning of life"<Esc>:wq<CR>

0 comments

#51 Alok Singh / TheRevAlokSingh - Score: 289 - 03/25/15 @ 05:51
<Down><Down><Down><Down><Down><Down><Down><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><BS>jljkklhllllllllllhhhhhhhhhhh      lhjkjjjjjkkkkkkkkkklhhhhhh<C-N><C-N>kklllllllllljkkkkkkkkhhhh/<Esc>:s <BS>/\.Ass<BS><BS><BS><BS><BS>ass<BS><BS><BS><Esc><Esc><Esc><Esc>l<BS><BS>lhistatic<C-H><C-H><C-H><C-H><C-H><C-H> static l<BS><BS><C-H><C-H><Left><Right>ic<Right><Left><Esc>wwwwhls<Esc>li.<Esc>hlxld<Esc>A.assertEquals<BS>s:<BS>;<Esc>j5ggdwx<BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS>jjjjllhhvllllllllllllllllyhhhvhp<Esc>jjjjkkkjjjjjjjjjjjjjjj:wq<CR>

0 comments

Created by: quadface

51 active golfers, 148 entries

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

10/03/2014 at 08:39PM

28
#2 - Petro Тrouq / zulolosi

10/04/2014 at 03:19AM

28
#3 - John Braxler / braxler

10/06/2014 at 05:49PM

28
#4 - Daniel Pham / dany_pham

10/13/2014 at 05:40AM

28
#5 - Davy Dovanton / anton_davydov

10/22/2014 at 06:38PM

28
#6 - ———đίxίє—flαтlίиє——— / _dixie_flatline

11/02/2014 at 07:22PM

28
#7 - Ivan Brennan / ivanbrennan

12/08/2014 at 04:00AM

28
#8 - Jon Krause / jkrause314

11/17/2015 at 06:59AM

29
#9 - Caek / Caek_

10/04/2014 at 01:50PM

29
#10 - Rob Speller / robSE13

10/04/2014 at 08:57PM

29
#11 - Kai Yuan / kentyuan

10/05/2014 at 10:47AM

29
#12 - Ram Tamtam / ramtamtamtam

10/07/2014 at 02:29PM

29
#13 - Daniel Burnett / mango_cheetah

10/09/2014 at 10:17PM

29
#14 - Sergei Zhgirovski / Ixanezis

10/10/2014 at 08:42PM

29
#15 - Dane Summers / dsummersl

10/29/2014 at 01:39PM

29
#16 - eBrnd / eBrnd

11/02/2014 at 03:11PM

29
#17 - Josu Oyanguren / josuoyanguren

12/18/2014 at 11:14AM

29
#18 - Filipe Almeida / filipe_almeida

01/01/2015 at 03:20AM

29
#19 - Carlos A Henríquez Q / lagunex

01/18/2015 at 10:22AM

29
#20 - mark0829 / mark0829

02/03/2015 at 12:36PM

29
#21 - xieyh11 / xieyh11

03/01/2015 at 03:23AM

29
#22 - pftb12345 / pftb12345

04/10/2015 at 09:17AM

29
#23 - Daniel / Daniel00288663

04/05/2017 at 02:12PM

30
#24 - Zapata / Incredible_JFP

10/25/2014 at 07:00PM

30
#25 - kungfuchad / kungfuchad

11/19/2014 at 08:06PM

32
#26 - mnx / mnxx

10/15/2014 at 11:01AM

32
#27 - Matthieu Crapet / mcr05

12/11/2014 at 11:04PM

33
#28 - Carlos López / morrizon

10/04/2014 at 12:14AM

35
#29 - r. / rmarvie

12/19/2014 at 05:13PM

35
#30 - ltn614 / ltn614

09/22/2015 at 09:04AM

36
#31 - Oliver Christ / 0liverChrist

02/14/2015 at 05:51PM

37
#32 - Dmitry Teslenko / krab_mozga

10/09/2014 at 01:24PM

37
#33 - w1zeman1p / wizemanip

11/09/2014 at 06:07AM

37
#34 - Walker Boh / walker_boh

10/16/2015 at 10:59AM

38
#35 - Maxim / HateLinux

10/09/2014 at 06:51AM

39
#36 - Paweł Max K. / ktorek

10/04/2014 at 10:02AM

39
#37 - simonced / simonced

10/06/2014 at 11:21PM

39
#38 - Sabiki94@ブルスクの人 / _jptomoya

10/17/2014 at 01:18PM

39
#39 - Kristijan Husak / kristijan_husak

02/02/2015 at 10:04PM

40
#40 - JForstreuter / JForstr

10/06/2014 at 01:42PM

40
#41 - takashi / k_takashi0309

10/08/2014 at 01:41PM

41
#42 - SilentFl / Silent_Fl

01/27/2015 at 01:26PM

41
#43 - Gerald Tilma / GeraldTilma

10/22/2015 at 02:52AM

43
#44 - James / Dronak

10/03/2014 at 10:31PM

43
#45 - Nate Eagleson / NateEag

10/05/2014 at 01:18AM

43
#46 - ɐʇnɥsɐpoʇ / todashuta

03/26/2015 at 07:32AM

49
#47 - Jakob / jajob

10/06/2014 at 05:53PM

49
#48 - Narek / NarekCat

10/10/2014 at 07:18PM

54
#49 - RobertT / techrt2050

10/05/2014 at 04:25AM

62
#50 - LSMTD / LSMTD

12/09/2014 at 03:39AM

289
#51 - Alok Singh / TheRevAlokSingh

03/25/2015 at 05:51AM