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

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

141 active golfers, 430 entries

Solutions by @mrmclarrinson:
19
#21 - Mrmclarrinson / @mrmclarrinson

12/13/2022 at 12:19PM

20
#>31 - Mrmclarrinson / @mrmclarrinson

12/13/2022 at 12:18PM

21
#>79 - Mrmclarrinson / @mrmclarrinson

12/13/2022 at 12:17PM

22
#>96 - Mrmclarrinson / @mrmclarrinson

12/13/2022 at 12:15PM

22
#>96 - Mrmclarrinson / @mrmclarrinson

12/13/2022 at 12:16PM

24
#>107 - Mrmclarrinson / @mrmclarrinson

12/13/2022 at 12:14PM

25
#>110 - Mrmclarrinson / @mrmclarrinson

12/13/2022 at 12:13PM

26
#>115 - Mrmclarrinson / @mrmclarrinson

12/13/2022 at 12:12PM

28
#>119 - Mrmclarrinson / @mrmclarrinson

12/13/2022 at 12:11PM

29
#>124 - Mrmclarrinson / @mrmclarrinson

12/13/2022 at 12:04PM