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

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

141 active golfers, 430 entries

Solutions by @tomkpz:
20
#30 - Michel Viktor / @tomkpz

07/31/2021 at 04:38AM

21
#>77 - Michel Viktor / @tomkpz

07/31/2021 at 04:37AM

22
#>96 - Michel Viktor / @tomkpz

07/31/2021 at 04:36AM

23
#>102 - Michel Viktor / @tomkpz

07/31/2021 at 04:35AM

24
#>107 - Michel Viktor / @tomkpz

07/31/2021 at 04:34AM

25
#>110 - Michel Viktor / @tomkpz

07/31/2021 at 04:33AM

26
#>114 - Michel Viktor / @tomkpz

07/31/2021 at 04:32AM

28
#>119 - Michel Viktor / @tomkpz

07/31/2021 at 04:32AM

31
#>130 - Michel Viktor / @tomkpz

07/31/2021 at 04:29AM

32
#>132 - Michel Viktor / @tomkpz

07/31/2021 at 04:29AM

33
#>134 - Michel Viktor / @tomkpz

07/31/2021 at 04:28AM

34
#>134 - Michel Viktor / @tomkpz

07/31/2021 at 04:26AM