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

37 active golfers, 132 entries

Leaderboard (lowest score wins):
59
#1 - John Braxler / @braxler

11/15/2021 at 04:05PM

59
#2 - Jon Krause / @jkrause314

11/23/2021 at 11:03PM

59
#3 - Roni Kettunen / @Ronsteri1

11/26/2021 at 01:10AM

59
#4 - Petro Тrouq / @zulolosi

11/29/2021 at 02:01PM

59
#5 - Pedro Minicz / @pedrominicz

03/25/2022 at 08:51PM

59
#6 - Marc Jethro Avila / @maje_avila

05/10/2022 at 12:05PM

63
#7 - Marcel Rød / @marcelroed

11/17/2021 at 07:42PM

64
#8 - Jean George / @JeanGeo20504212

11/16/2021 at 04:58PM

64
#9 - TimMcGuire / @mcguire

11/19/2021 at 03:10AM

67
#10 - mevmev / @mevmev8

11/19/2021 at 10:58PM

67
#11 - Vegard Henriksen / @MrVegard

12/04/2021 at 01:40PM

67
#12 - POSIX / @po6ix

01/07/2022 at 11:21AM

67
#13 - Ramtin Martin / @martin_ramtin

03/28/2022 at 02:35PM

72
#14 - A Random Vimgolfer / @AVimgolfer

02/04/2022 at 08:23AM

72
#15 - D. 👋 / @DCT_cpp

02/14/2022 at 04:14PM

73
#16 - AMG / @anmigneer

12/14/2021 at 12:02PM

73
#17 - Brian Leung / @brian_leung

02/01/2022 at 05:49AM

74
#18 - Javier Contreras / @contranton

05/04/2022 at 02:55AM

80
#19 - JVIM / @JVIM101

02/28/2022 at 11:29AM

83
#20 - stwice / @stwice

02/03/2022 at 05:48PM

87
#21 - Matthias Bartsch 🏠 / @MBartsch

02/21/2022 at 12:52PM

87
#22 - Il Granfiatore / @M_Klauer

02/22/2022 at 06:50AM

88
#23 - Arya Kumar / @SusSquirrel

12/19/2021 at 03:51PM

90
#24 - sap / @sap38838304

12/24/2021 at 08:32PM

90
#25 - Ju / @Heckrothing

02/12/2022 at 01:26PM

90
#26 - Ashley Feniello / @AshleyFen

02/22/2022 at 01:48AM

93
#27 - Adam Sanghera / @AdamSanghera

01/17/2022 at 09:58PM

95
#28 - Marhekk / @Marhekk

11/23/2021 at 12:28AM

96
#29 - Sammit / @somemeatjain

01/22/2022 at 04:17PM

99
#30 - Ken / @kenc_

01/19/2022 at 04:00AM