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

Compile C

You might have to get clever to do this one.

Start file
int main()
{
  char *s = "Hello, world!";
  int i, j;

  for (i = 0; s[i]; i++) {
    for (j = 0; j <= i; j++)
      putchar(s[j]);
    putchar('\n');
  }

  return 0;
}
End file
H
He
Hel
Hell
Hello
Hello,
Hello, 
Hello, w
Hello, wo
Hello, wor
Hello, worl
Hello, world
Hello, world!

View Diff

1,13c1,13
< int main()
< {
<   char *s = "Hello, world!";
<   int i, j;
< 
<   for (i = 0; s[i]; i++) {
<     for (j = 0; j <= i; j++)
<       putchar(s[j]);
<     putchar('\n');
<   }
< 
<   return 0;
< }
---
> H
> He
> Hel
> Hell
> Hello
> Hello,
> Hello, 
> Hello, w
> Hello, wo
> Hello, wor
> Hello, worl
> Hello, world
> Hello, world!

Solutions by @me_coot:

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

140 active golfers, 420 entries

Solutions by @me_coot:
20
#28 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:41PM

20
#>28 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:43PM

21
#>66 - Marcin Szamotulski / @me_coot

11/24/2012 at 05:07PM

21
#>67 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:28PM

22
#>87 - Marcin Szamotulski / @me_coot

11/24/2012 at 04:50PM

22
#>90 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:27PM

23
#>97 - Marcin Szamotulski / @me_coot

11/24/2012 at 04:48PM

24
#>105 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:24PM

24
#>105 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:26PM

25
#>107 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:22PM

26
#>112 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:27PM

28
#>118 - Marcin Szamotulski / @me_coot

11/24/2012 at 05:04PM

34
#>133 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:42PM