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

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

208 active golfers, 604 entries

Solutions by @bounce114:
25
#28 - bounce114 / @bounce114

12/03/2024 at 06:32AM

26
#>41 - bounce114 / @bounce114

12/03/2024 at 06:30AM

27
#>52 - bounce114 / @bounce114

12/03/2024 at 06:27AM

27
#>52 - bounce114 / @bounce114

12/03/2024 at 06:29AM

28
#>71 - bounce114 / @bounce114

12/03/2024 at 06:18AM

28
#>71 - bounce114 / @bounce114

12/03/2024 at 06:26AM

28
#>71 - bounce114 / @bounce114

12/03/2024 at 06:27AM

29
#>87 - bounce114 / @bounce114

12/03/2024 at 06:15AM

29
#>87 - bounce114 / @bounce114

12/03/2024 at 06:17AM

32
#>116 - bounce114 / @bounce114

12/03/2024 at 06:11AM

35
#>143 - bounce114 / @bounce114

12/02/2024 at 09:34AM

35
#>143 - bounce114 / @bounce114

12/03/2024 at 06:06AM

37
#>154 - bounce114 / @bounce114

12/02/2024 at 09:28AM

37
#>154 - bounce114 / @bounce114

12/02/2024 at 09:29AM

41
#>180 - bounce114 / @bounce114

12/02/2024 at 09:27AM