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

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

143 active golfers, 441 entries

Solutions by @bounce114:
20
#33 - bounce114 / @bounce114

12/07/2024 at 06:56AM

21
#>81 - bounce114 / @bounce114

12/07/2024 at 06:52AM

22
#>98 - bounce114 / @bounce114

12/07/2024 at 06:50AM

23
#>104 - bounce114 / @bounce114

12/07/2024 at 06:50AM

24
#>108 - bounce114 / @bounce114

12/07/2024 at 06:47AM

25
#>111 - bounce114 / @bounce114

12/07/2024 at 06:46AM

26
#>117 - bounce114 / @bounce114

12/07/2024 at 06:39AM

27
#>120 - bounce114 / @bounce114

12/07/2024 at 06:45AM

33
#>135 - bounce114 / @bounce114

12/07/2024 at 06:34AM

41
#>140 - bounce114 / @bounce114

12/07/2024 at 06:34AM