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

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

114 active golfers, 287 entries

Solutions by @Toribash:
22
#77 - Nabi Studios / @Toribash

03/28/2014 at 10:28AM

24
#>88 - Nabi Studios / @Toribash

03/28/2014 at 10:26AM

25
#>90 - Nabi Studios / @Toribash

03/28/2014 at 10:17AM

26
#>95 - Nabi Studios / @Toribash

03/28/2014 at 10:15AM

26
#>95 - Nabi Studios / @Toribash

03/28/2014 at 10:22AM

28
#>98 - Nabi Studios / @Toribash

03/28/2014 at 10:14AM

30
#>104 - Nabi Studios / @Toribash

03/28/2014 at 10:12AM

32
#>108 - Nabi Studios / @Toribash

03/28/2014 at 10:10AM