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

55 active golfers, 161 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 - Anton Davydov / @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

28
#9 - Turkey Man / @lvturkeyman

12/01/2017 at 05:26PM

28
#10 - DHM / @DHM29978992

05/28/2018 at 01:47AM

29
#11 - Caek / @Caek_

10/04/2014 at 01:50PM

29
#12 - Rob Speller / @robSE13

10/04/2014 at 08:57PM

29
#13 - Kai Yuan / @kentyuan

10/05/2014 at 10:47AM

29
#14 - Ram Tamtam / @ramtamtamtam

10/07/2014 at 02:29PM

29
#15 - Daniel Burnett / @mango_cheetah

10/09/2014 at 10:17PM

29
#16 - Sergei Zhgirovski / @Ixanezis

10/10/2014 at 08:42PM

29
#17 - Dane Summers / @dsummersl

10/29/2014 at 01:39PM

29
#18 - eBrnd / @eBrnd

11/02/2014 at 03:11PM

29
#19 - Josu Oyanguren / @josuoyanguren

12/18/2014 at 11:14AM

29
#20 - Filipe Almeida / @filipe_almeida

01/01/2015 at 03:20AM

29
#21 - Carlos A Henríquez Q / @lagunex

01/18/2015 at 10:22AM

29
#22 - mark0829 / @mark0829

02/03/2015 at 12:36PM

29
#23 - xieyh11 / @xieyh11

03/01/2015 at 03:23AM

29
#24 - pftb12345 / @pftb12345

04/10/2015 at 09:17AM

29
#25 - Daniel / @Daniel00288663

04/05/2017 at 02:12PM

30
#26 - Zapata / @Incredible_JFP

10/25/2014 at 07:00PM

30
#27 - kungfuchad / @kungfuchad

11/19/2014 at 08:06PM

32
#28 - mnx / @mnxx

10/15/2014 at 11:01AM

32
#29 - Matthieu Crapet / @mcr05

12/11/2014 at 11:04PM

33
#30 - Carlos López / @morrizon

10/04/2014 at 12:14AM