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 by @maje_avila:

Unlock 10 remaining solutions by signing in and submitting your own entry
Created by: @thari_eth

66 active golfers, 256 entries

Solutions by @maje_avila:
59
#6 - Marc Jethro Avila / @maje_avila

05/10/2022 at 12:05PM

64
#>15 - Marc Jethro Avila / @maje_avila

05/10/2022 at 11:50AM

64
#>15 - Marc Jethro Avila / @maje_avila

05/10/2022 at 11:53AM

67
#>21 - Marc Jethro Avila / @maje_avila

05/10/2022 at 11:42AM

72
#>24 - Marc Jethro Avila / @maje_avila

05/09/2022 at 11:02PM

80
#>31 - Marc Jethro Avila / @maje_avila

05/09/2022 at 10:39PM

82
#>32 - Marc Jethro Avila / @maje_avila

05/09/2022 at 10:37PM

91
#>41 - Marc Jethro Avila / @maje_avila

05/09/2022 at 10:30PM

93
#>44 - Marc Jethro Avila / @maje_avila

05/09/2022 at 10:25PM

96
#>47 - Marc Jethro Avila / @maje_avila

05/09/2022 at 10:19PM