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 56 remaining solutions by signing in and submitting your own entry
#57 盧小小 / @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

57 active golfers, 216 entries

Leaderboard (lowest score wins):
87
#31 - Il Granfiatore / @M_Klauer

02/22/2022 at 06:50AM

88
#32 - Arya Kumar / @SusSquirrel

12/19/2021 at 03:51PM

88
#33 - Michał / @Micha46184564

10/26/2022 at 09:32PM

89
#34 - Иван / @wansmer

04/23/2023 at 03:21PM

90
#35 - Ju / @Heckrothing

02/12/2022 at 01:26PM

90
#36 - Ashley Feniello / @AshleyFen

02/22/2022 at 01:48AM

92
#37 - Will Long / @WillLon30283972

06/19/2022 at 11:23PM

93
#38 - Adam Sanghera / @AdamSanghera

01/17/2022 at 09:58PM

95
#39 - Marhekk / @Marhekk

11/23/2021 at 12:28AM

95
#40 - 스치 / @champemunasong

10/27/2022 at 05:49AM

96
#41 - Sammit / @somemeatjain

01/22/2022 at 04:17PM

96
#42 - 'ymdarake / @ymdarake

08/29/2022 at 12:34PM

96
#43 - Elia Camposilvan / @EliaECoyote

10/06/2022 at 07:47AM

99
#44 - Ken / @kenc_

01/19/2022 at 04:00AM

99
#45 - Terry Tsao / @TerryTsao9008

03/16/2022 at 04:53AM

100
#46 - sdfghjk / @sdfghjk88424595

04/28/2022 at 12:01AM

102
#47 - Paul Page / @theRealPaulPage

01/21/2022 at 10:16PM

102
#48 - Pacific Grove / @frank_green_012

03/31/2023 at 05:46AM

108
#49 - Pieter-Jan Lavaerts / @Pumpkin_Pie_Eat

09/26/2022 at 09:24AM

108
#50 - Dank City / @ddankcity

12/09/2022 at 05:27PM

111
#51 - Hydrazar / @scpchickenbird

11/14/2021 at 09:45PM

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

08/07/2022 at 03:11AM

131
#53 - Albertas Gimbutas / @explorehomemore

11/14/2021 at 06:29PM

138
#54 - 0xf00ff00f / @0xf00ff00f

12/04/2022 at 10:53PM

169
#55 - Driver / @zhouyijiaren

06/11/2022 at 11:43AM

200
#56 - oleg / @oleg12573505

01/29/2022 at 02:21PM

204
#57 - 盧小小 / @VegetaLu

04/01/2022 at 04:51PM