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):
54
#61 - RobertT / @techrt2050

10/05/2014 at 04:25AM

56
#62 - Austin Ware / @AustinWare17

03/13/2018 at 04:46AM

62
#63 - LSMTD / @LSMTD

12/09/2014 at 03:39AM

289
#64 - Alok Singh / @TheRevAlokSingh

03/25/2015 at 05:51AM