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

58 active golfers, 180 entries

Leaderboard (lowest score wins):
33
#31 - Carlos López / @morrizon

10/04/2014 at 12:14AM

35
#32 - r. / @rmarvie

12/19/2014 at 05:13PM

35
#33 - ltn614 / @ltn614

09/22/2015 at 09:04AM

36
#34 - Oliver Christ / @0liverChrist

02/14/2015 at 05:51PM

37
#35 - Dmitry Teslenko / @krab_mozga

10/09/2014 at 01:24PM

37
#36 - w1zeman1p / @wizemanip

11/09/2014 at 06:07AM

37
#37 - Walker Boh / @walker_boh

10/16/2015 at 10:59AM

37
#38 - PJ Frazer / @pj_frazer

11/30/2018 at 02:40AM

38
#39 - Maxim / @HateLinux

10/09/2014 at 06:51AM

39
#40 - Paweł Max K. / @ktorek

10/04/2014 at 10:02AM

39
#41 - simonced / @simonced

10/06/2014 at 11:21PM

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

10/17/2014 at 01:18PM

39
#43 - Kristijan Husak / @kristijan_husak

02/02/2015 at 10:04PM

40
#44 - JForstreuter / @JForstr

10/06/2014 at 01:42PM

40
#45 - takashi / @k_takashi0309

10/08/2014 at 01:41PM

41
#46 - SilentFl / @Silent_Fl

01/27/2015 at 01:26PM

41
#47 - Gerald Tilma / @GeraldTilma

10/22/2015 at 02:52AM

41
#48 - Gurukandhamoorthi / @Gurukandhamoor1

08/14/2017 at 03:29PM

43
#49 - James / @Dronak

10/03/2014 at 10:31PM

43
#50 - Nate Eagleson / @NateEag

10/05/2014 at 01:18AM

43
#51 - ɐʇnɥsɐpoʇ / @todashuta

03/26/2015 at 07:32AM

49
#52 - Jakob / @jajob

10/06/2014 at 05:53PM

49
#53 - Narek / @NarekCat

10/10/2014 at 07:18PM

50
#54 - Dr. Rev. J. "Paranoid Android" Kirchartz / @JKirchartz

10/30/2018 at 08:45PM

54
#55 - RobertT / @techrt2050

10/05/2014 at 04:25AM

56
#56 - Austin Ware / @AustinWare17

03/13/2018 at 04:46AM

62
#57 - LSMTD / @LSMTD

12/09/2014 at 03:39AM

289
#58 - Alok Singh / @TheRevAlokSingh

03/25/2015 at 05:51AM