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

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

199 active golfers, 552 entries

Solutions by @poeminlash:
22
#3 - Qing Liu / @poeminlash

08/07/2022 at 02:50AM

23
#>7 - Qing Liu / @poeminlash

08/07/2022 at 02:49AM

25
#>23 - Qing Liu / @poeminlash

08/07/2022 at 02:48AM

26
#>37 - Qing Liu / @poeminlash

08/07/2022 at 02:47AM

27
#>48 - Qing Liu / @poeminlash

08/07/2022 at 02:46AM

28
#>63 - Qing Liu / @poeminlash

08/07/2022 at 02:43AM

29
#>79 - Qing Liu / @poeminlash

08/07/2022 at 02:43AM

30
#>87 - Qing Liu / @poeminlash

08/07/2022 at 02:40AM

31
#>98 - Qing Liu / @poeminlash

08/07/2022 at 02:39AM

32
#>108 - Qing Liu / @poeminlash

08/07/2022 at 02:36AM

33
#>116 - Qing Liu / @poeminlash

08/07/2022 at 02:34AM

34
#>128 - Qing Liu / @poeminlash

08/07/2022 at 02:34AM

35
#>135 - Qing Liu / @poeminlash

07/20/2022 at 12:44AM