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 4d1ac1800a045132c0000011

Reformat a C golf submission

Take this C golf submission (for the "tiny but standards-compliant Hello World program" category, naturally), and turn it into formatted C code.

Start file
#include<stdio.h>
int main(void){puts("Hello world!");return 0;}
End file
#include <stdio.h>

int main(void)
{
    puts("Hello world!");
    return 0;
}

View Diff

--- hw.c	2010-12-28 21:01:54.000000000 -0800
+++ hw-indented.c	2010-12-28 21:04:56.000000000 -0800
@@ -1,2 +1,7 @@
-#include<stdio.h>
-int main(void){puts("Hello world!");return 0;}
+#include <stdio.h>
+
+int main(void)
+{
+    puts("Hello world!");
+    return 0;
+}

Solutions by @mmcilree:

Unlock 17 remaining solutions by signing in and submitting your own entry
Created by: @josh_triplett

222 active golfers, 681 entries

Solutions by @mmcilree:
22
#7 - Matthew J McIlree / @mmcilree

08/06/2026 at 04:07PM

23
#>11 - Matthew J McIlree / @mmcilree

08/06/2026 at 04:05PM

24
#>12 - Matthew J McIlree / @mmcilree

08/06/2026 at 04:03PM

25
#>32 - Matthew J McIlree / @mmcilree

08/06/2026 at 03:58PM

26
#>45 - Matthew J McIlree / @mmcilree

08/06/2026 at 03:26PM

27
#>56 - Matthew J McIlree / @mmcilree

08/06/2026 at 03:17PM

28
#>77 - Matthew J McIlree / @mmcilree

08/06/2026 at 03:15PM

29
#>93 - Matthew J McIlree / @mmcilree

08/06/2026 at 03:14PM

30
#>101 - Matthew J McIlree / @mmcilree

08/06/2026 at 03:04PM

31
#>112 - Matthew J McIlree / @mmcilree

08/06/2026 at 03:03PM

32
#>124 - Matthew J McIlree / @mmcilree

08/05/2026 at 03:16PM

32
#>124 - Matthew J McIlree / @mmcilree

08/06/2026 at 03:02PM

32
#>124 - Matthew J McIlree / @mmcilree

08/06/2026 at 03:13PM

33
#>134 - Matthew J McIlree / @mmcilree

07/31/2026 at 07:21PM

34
#>146 - Matthew J McIlree / @mmcilree

07/31/2026 at 06:57PM

36
#>162 - Matthew J McIlree / @mmcilree

08/05/2026 at 03:12PM

38
#>171 - Matthew J McIlree / @mmcilree

07/31/2026 at 06:52PM