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 @HaskellElephant:

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

208 active golfers, 604 entries

Solutions by @HaskellElephant:
28
#57 - Eivind Jahren / @HaskellElephant

03/28/2011 at 10:07AM

29
#>78 - Eivind Jahren / @HaskellElephant

01/26/2011 at 11:14PM

35
#>138 - Eivind Jahren / @HaskellElephant

01/26/2011 at 11:04PM

36
#>147 - Eivind Jahren / @HaskellElephant

01/26/2011 at 11:00PM

37
#>152 - Eivind Jahren / @HaskellElephant

01/26/2011 at 10:44PM