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 73 remaining solutions by signing in and submitting your own entry
#74 Duy nguyễn / @Duycld03 - Score: 212 - 07/27/23 @ 18:34
df jjqqdwqjV10gg:noraml<BS><BS><BS>mal @q<CR>kiVimGolf.<Esc>>>kkbciw<Esc>xA<Esc>bbbbbbciw<BS><Esc>lxi<CR><Esc>f(ldt<Esc>df]<Esc>A<Esc>kjjjA<Esc>F;lDlllkkkkk0df<Esc>ddt<Esc>udt(iconsole.log9<Esc>x<Esc>jkkkbbciw<Esc>sx<BS><Esc>wwbciw<BS><Esc>lxi<CR><Esc>A<Esc>kkjVjjjjjjjjj><Esc>jjj>.>><Esc>jjjjjlyf.jjjo<Esc>pamain([]);<Esc>:wq<CR>

0 comments


Created by: @thari_eth

74 active golfers, 269 entries

Leaderboard (lowest score wins):
108
#61 - Dank City / @ddankcity

12/09/2022 at 05:27PM

108
#62 - Jelani Felix / @Jelanife

03/21/2024 at 04:10AM

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

08/07/2022 at 03:11AM

130
#64 - Alexandre GV. / @alexandregv

07/12/2024 at 08:19PM

131
#65 - Albertas Gimbutas / @explorehomemore

11/14/2021 at 06:29PM

138
#66 - 0xf00ff00f / @0xf00ff00f

12/04/2022 at 10:53PM

138
#67 - Bùi Lê Huỳnh / @wyattbui

06/09/2024 at 06:34AM

140
#68 - Haruaki Tomida / @haruyan-hopemucci

12/06/2024 at 08:48AM

145
#69 - Maurice Schmicking / @m_schmicking

12/02/2023 at 12:57PM

151
#70 - LandR / @ListenAndR

10/24/2023 at 07:16AM

169
#71 - Driver / @zhouyijiaren

06/11/2022 at 11:43AM

200
#72 - oleg / @oleg12573505

01/29/2022 at 02:21PM

204
#73 - 盧小小 / @VegetaLu

04/01/2022 at 04:51PM

212
#74 - Duy nguyễn / @Duycld03

07/27/2023 at 06:34PM