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):
30
#31 - Zapata / @Incredible_JFP

10/25/2014 at 07:00PM

30
#32 - kungfuchad / @kungfuchad

11/19/2014 at 08:06PM

32
#33 - mnx / @mnxx

10/15/2014 at 11:01AM

32
#34 - Matt / @mcr05

12/11/2014 at 11:04PM

33
#35 - Carlos López / @morrizon

10/04/2014 at 12:14AM

34
#36 - RockerZZY / @rocker_zzy

07/17/2020 at 01:11PM

35
#37 - r. / @rmarvie

12/19/2014 at 05:13PM

35
#38 - ltn614 / @ltn614

09/22/2015 at 09:04AM

36
#39 - Oliver Christ / @0liverChrist

02/14/2015 at 05:51PM

37
#40 - Dmitry Teslenko / @krab_mozga

10/09/2014 at 01:24PM

37
#41 - CJ Avilla / @cjav_dev

11/09/2014 at 06:07AM

37
#42 - Walker Boh / @walker_boh

10/16/2015 at 10:59AM

37
#43 - PJ Frazer / @pj_frazer

11/30/2018 at 02:40AM

37
#44 - James / @Dronak

11/04/2022 at 08:13PM

38
#45 - Maxim / @HateLinux

10/09/2014 at 06:51AM

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

10/04/2014 at 10:02AM

39
#47 - simonced / @simonced

10/06/2014 at 11:21PM

39
#48 - jptomoya / @_jptomoya

10/17/2014 at 01:18PM

39
#49 - Kristijan Husak / @kristijan_husak

02/02/2015 at 10:04PM

40
#50 - JForstreuter / @JForstr

10/06/2014 at 01:42PM

40
#51 - takashi / @k_takashi0309

10/08/2014 at 01:41PM

41
#52 - SilentFl / @Silent_Fl

01/27/2015 at 01:26PM

41
#53 - Gerald Tilma / @GeraldTilma

10/22/2015 at 02:52AM

41
#54 - Gurukandhamoorthi / @Gurukandhamoor1

08/14/2017 at 03:29PM

42
#55 - Olivier Bégassat / @zk_evm

06/14/2023 at 09:46PM

43
#56 - Nate Eagleson / @NateEag

10/05/2014 at 01:18AM

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

03/26/2015 at 07:32AM

49
#58 - Jakob / @jajob

10/06/2014 at 05:53PM

49
#59 - Narek / @NarekCat

10/10/2014 at 07:18PM

50
#60 - Dr Rev J. “I am not a bot!” Kirchartz, KSC, KHS / @JKirchartz

10/30/2018 at 08:45PM