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

64 active golfers, 199 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

28
#11 - vimgolfer / @vimgolfer7

12/01/2019 at 03:38AM

28
#12 - Peppa Pig / @PeppaPigSg

07/03/2024 at 03:53AM

29
#13 - Caek / @Caek_

10/04/2014 at 01:50PM

29
#14 - Rob Speller / @robSE13

10/04/2014 at 08:57PM

29
#15 - Kai Yuan / @kentyuan

10/05/2014 at 10:47AM

29
#16 - Ram Tamtam / @ramtamtamtam

10/07/2014 at 02:29PM

29
#17 - Daniel Burnett / @mango_cheetah

10/09/2014 at 10:17PM

29
#18 - Sergei Zhgirovski / @Ixanezis

10/10/2014 at 08:42PM

29
#19 - Dane Summers / @dsummersl

10/29/2014 at 01:39PM

29
#20 - eBrnd / @eBrnd

11/02/2014 at 03:11PM

29
#21 - Josu Oyanguren / @josuoyanguren

12/18/2014 at 11:14AM

29
#22 - Filipe Almeida / @filipe_almeida

01/01/2015 at 03:20AM

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

01/18/2015 at 10:22AM

29
#24 - mark0829 / @mark0829

02/03/2015 at 12:36PM

29
#25 - xieyh11 / @xieyh11

03/01/2015 at 03:23AM

29
#26 - pftb12345 / @pftb12345

04/10/2015 at 09:17AM

29
#27 - Daniel / @Daniel00288663

04/05/2017 at 02:12PM

29
#28 - Mihai / @mihaicristiant

04/01/2019 at 12:55PM

29
#29 - Jean George / @JeanGeo20504212

06/01/2022 at 03:10PM

29
#30 - quemeraisc / @quemeraisc

06/02/2022 at 09:30AM