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

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

132 active golfers, 365 entries

Solutions by @poeminlash:
19
#19 - Qing Liu / @poeminlash

07/30/2022 at 02:54AM

20
#>27 - Qing Liu / @poeminlash

07/30/2022 at 02:46AM

21
#>74 - Qing Liu / @poeminlash

07/30/2022 at 02:45AM

22
#>91 - Qing Liu / @poeminlash

07/30/2022 at 02:43AM

23
#>97 - Qing Liu / @poeminlash

07/30/2022 at 02:43AM

25
#>104 - Qing Liu / @poeminlash

07/30/2022 at 02:42AM

26
#>109 - Qing Liu / @poeminlash

07/30/2022 at 02:42AM

27
#>113 - Qing Liu / @poeminlash

07/30/2022 at 02:38AM

29
#>118 - Qing Liu / @poeminlash

07/30/2022 at 02:37AM

30
#>120 - Qing Liu / @poeminlash

07/30/2022 at 02:36AM

31
#>123 - Qing Liu / @poeminlash

07/30/2022 at 02:34AM

32
#>125 - Qing Liu / @poeminlash

07/30/2022 at 02:33AM

33
#>126 - Qing Liu / @poeminlash

07/30/2022 at 02:32AM

34
#>126 - Qing Liu / @poeminlash

07/30/2022 at 02:30AM