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):
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

59
#7 - jcbglbmn / @JacobGelbman

05/23/2022 at 05:31AM

59
#8 - Leroy Jenkins / @LeroyJe70429357

09/17/2022 at 04:49AM

59
#9 - Topvimgolf Score / @topvimgolfscore

10/15/2022 at 10:38AM

63
#10 - Marcel Rød / @marcelroed

11/17/2021 at 07:42PM

64
#11 - Jean George / @JeanGeo20504212

11/16/2021 at 04:58PM

64
#12 - TimMcGuire / @mcguire

11/19/2021 at 03:10AM

64
#13 - sap / @sap38838304

09/16/2022 at 08:34PM

67
#14 - mevmev / @mevmev8

11/19/2021 at 10:58PM

67
#15 - Vegard Henriksen / @MrVegard

12/04/2021 at 01:40PM

67
#16 - POSIX / @po6ix

01/07/2022 at 11:21AM

67
#17 - Ramtin Martin / @martin_ramtin

03/28/2022 at 02:35PM

72
#18 - A Random Vimgolfer / @AVimgolfer

02/04/2022 at 08:23AM

72
#19 - D. 👋 / @DCT_cpp

02/14/2022 at 04:14PM

73
#20 - AMG / @anmigneer

12/14/2021 at 12:02PM

73
#21 - Brian Leung / @brian_leung

02/01/2022 at 05:49AM

73
#22 - vuems / @vuems2win

11/15/2022 at 12:29AM

74
#23 - Javier Contreras / @contranton

05/04/2022 at 02:55AM

78
#24 - Kiran Rajpurohit / @KiranClose

07/31/2022 at 11:19AM

79
#25 - Iron Manders / @MandersIron

10/31/2022 at 09:33PM

80
#26 - JVIM / @JVIM101

02/28/2022 at 11:29AM

80
#27 - Austin Willliams / @GuitarMusash616

09/21/2022 at 06:53AM

83
#28 - stwice / @stwice

02/03/2022 at 05:48PM

87
#29 - Matthias Bartsch 🏠 / @MBartsch

02/21/2022 at 12:52PM

87
#30 - Il Granfiatore / @M_Klauer

02/22/2022 at 06:50AM