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

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 140 remaining solutions by signing in and submitting your own entry
#141 Taras Parshenko / @Timestreched - Score: 151 - 04/30/12 @ 20:43
9dw3wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww<Left><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Up><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Left>47dwuu9dw3w49dwu48dwu47dwul47dwu48dw^qayyi<CR><Esc><Up>uqqayyp<Up>$x^q@au11@a:wq!<CR>

0 comments


Created by: @nooodl

141 active golfers, 430 entries

Leaderboard (lowest score wins):
29
#121 - uuu / @uu59

12/30/2010 at 06:07PM

29
#122 - bestform / @bestform

02/05/2011 at 09:35PM

29
#123 - Junfeng / @junfeng

07/20/2011 at 12:22PM

29
#124 - Ashley Feniello / @AshleyFen

01/29/2012 at 06:56AM

30
#125 - sidyll / @sidyll

07/04/2011 at 07:09PM

30
#126 - Jimmy McRascal / @JimmyMcRascal

07/17/2014 at 01:26AM

30
#127 - KoroneListener / @KoroneListener

09/04/2024 at 10:27AM

31
#128 - Julien Pivotto / @roidelapluie

03/17/2011 at 09:15PM

31
#129 - Gary Rennie / @TheGazler

08/01/2012 at 07:28PM

31
#130 - Sylvain Dangin / @Sylvaner03

02/24/2021 at 08:51PM

32
#131 - Guillaume Bonnoron / @gbonnoron

12/30/2010 at 03:22PM

32
#132 - Paul Schaefer / @schaeferpp

05/24/2019 at 03:26PM

32
#133 - guyontristan / @guyontristan

10/27/2024 at 10:39AM

33
#134 - Arto Vuori / @dhpe

09/01/2012 at 07:11PM

35
#135 - Kaustubh Murumkar / @k_austub_h

08/31/2020 at 06:44PM

35
#136 - shahanavaz m / @shahanavazm

01/29/2024 at 05:46AM

36
#137 - xiaoao1024 / @xiaoao1024

01/02/2024 at 03:20PM

37
#138 - ovo / @prokrastinatsia

08/12/2012 at 01:05AM

44
#139 - reatter / @reatter

09/17/2024 at 03:38PM

119
#140 - Charlie OConor / @charlieoconor

09/06/2019 at 08:12PM

151
#141 - Taras Parshenko / @Timestreched

04/30/2012 at 08:43PM