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 9v00618f9423000000000215

Java to JavaScript

Let convert some simple Java file to JavaScript!

Start file
public class VimGolf
{
   public static void sayHello()
   {
      System.out.println("Hello VimGolf");
   }
   public static void main(String []args)
   {
      sayHello();      
   }
}
End file
class VimGolf
{
	static
	sayHello()
	{
		console.log("Hello VimGolf");
	}
	static
	main(args)
	{
		VimGolf.sayHello();
	}
}
VimGolf.main([]);

View Diff

1c1
< public class VimGolf
---
> class VimGolf
3,10c3,12
<    public static void sayHello()
<    {
<       System.out.println("Hello VimGolf");
<    }
<    public static void main(String []args)
<    {
<       sayHello();      
<    }
---
> 	static
> 	sayHello()
> 	{
> 		console.log("Hello VimGolf");
> 	}
> 	static
> 	main(args)
> 	{
> 		VimGolf.sayHello();
> 	}
11a14
> VimGolf.main([]);

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 51 remaining solutions by signing in and submitting your own entry
#52 盧小小 / @VegetaLu - Score: 204 - 04/01/22 @ 16:51
:%s/public <CR>:%s/ void /\r<CR>:3<CR>0cw<Tab><Tab><BS><BS><Tab><Esc>j0i<Tab><Esc>j0cw<Tab><Esc>j0cw<Tab><Tab><Esc>j0cw<Tab><Esc>j0cw<Tab>j<BS><Esc>j0i<Tab><Esc>wwwdwxx<Esc>j0cw<Tab><Esc>j0.j0.<Esc>ki<Tab><Esc>wIvim<BS><BS><BS>VimGolf.<Esc>byiwGpbi<CR><Esc>A.main(p<BS>[]);<Esc>kkkA<BS><BS><BS><BS><BS><BS><Esc>kkkkkbbbbbdt(cons<Esc>uiC<BS>conslo.e<BS><BS><BS><BS><BS>sole.llg<BS><BS>og<Esc>:wq<CR>

0 comments


Created by: @thari_eth

52 active golfers, 207 entries

Leaderboard (lowest score wins):
88
#31 - Arya Kumar / @SusSquirrel

12/19/2021 at 03:51PM

88
#32 - Michał / @Micha46184564

10/26/2022 at 09:32PM

90
#33 - Ju / @Heckrothing

02/12/2022 at 01:26PM

90
#34 - Ashley Feniello / @AshleyFen

02/22/2022 at 01:48AM

92
#35 - Will Long / @WillLon30283972

06/19/2022 at 11:23PM

93
#36 - Adam Sanghera / @AdamSanghera

01/17/2022 at 09:58PM

95
#37 - Marhekk / @Marhekk

11/23/2021 at 12:28AM

95
#38 - Haizn Scie🔞 / @champemunasong

10/27/2022 at 05:49AM

96
#39 - Sammit / @somemeatjain

01/22/2022 at 04:17PM

96
#40 - 'ymdarake / @ymdarake

08/29/2022 at 12:34PM

96
#41 - Elia Camposilvan / @EliaECoyote

10/06/2022 at 07:47AM

99
#42 - Ken / @kenc_

01/19/2022 at 04:00AM

99
#43 - Terry Tsao / @TerryTsao9008

03/16/2022 at 04:53AM

100
#44 - sdfghjk / @sdfghjk88424595

04/28/2022 at 12:01AM

102
#45 - Paul Page / @theRealPaulPage

01/21/2022 at 10:16PM

108
#46 - Pieter-Jan Lavaerts / @Pumpkin_Pie_Eat

09/26/2022 at 09:24AM

111
#47 - Hydrazar / @hydrazar

11/14/2021 at 09:45PM

121
#48 - Александр Черенков / @AleksandrCeren3

08/07/2022 at 03:11AM

131
#49 - Albertas Gimbutas / @explorehomemore

11/14/2021 at 06:29PM

169
#50 - Driver / @zhouyijiaren

06/11/2022 at 11:43AM

200
#51 - oleg / @oleg12573505

01/29/2022 at 02:21PM

204
#52 - 盧小小 / @VegetaLu

04/01/2022 at 04:51PM