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

132 active golfers, 365 entries

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

10/12/2013 at 05:41PM

20
#>24 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:43PM

21
#>62 - Marcin Szamotulski / @me_coot

11/24/2012 at 05:07PM

21
#>63 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:28PM

22
#>83 - Marcin Szamotulski / @me_coot

11/24/2012 at 04:50PM

22
#>86 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:27PM

23
#>92 - Marcin Szamotulski / @me_coot

11/24/2012 at 04:48PM

24
#>100 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:24PM

24
#>100 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:26PM

25
#>102 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:22PM

26
#>107 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:27PM

28
#>113 - Marcin Szamotulski / @me_coot

11/24/2012 at 05:04PM

34
#>126 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:42PM