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 111 remaining solutions by signing in and submitting your own entry
#112 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

112 active golfers, 280 entries

Leaderboard (lowest score wins):
21
#31 - Joost / @vlabakje

02/21/2011 at 04:27PM

21
#32 - Pavlo Klets / @p01nt

02/25/2011 at 10:51AM

21
#33 - Paweu1kZ nbNeyIhH / @yUQlwsFpRSzxJFh

03/07/2011 at 12:57AM

21
#34 - Dragan Cvetinovic / @kawkafi

05/12/2011 at 09:13PM

21
#35 - Johan Sveholm / @rymdtjuren

06/30/2011 at 08:00AM

21
#36 - Sammasati / @sammasati0

07/16/2011 at 05:40PM

21
#37 - Dave / @zzdave13

07/29/2011 at 09:35AM

21
#38 - Tim Tsu / @vimgolfpunk

09/14/2011 at 09:44PM

21
#39 - William Dunand / @wdunand

11/29/2011 at 02:24AM

21
#40 - You-Siang Lin / @yslinnctu

12/02/2011 at 02:23AM

21
#41 - Xavier Nayrac / @lkdjiin

12/30/2011 at 02:11PM

21
#42 - Calvin Condon / @ccondon

02/01/2012 at 05:09AM

21
#43 - Renat Aksitov / @Korvin79

02/08/2012 at 12:49PM

21
#44 - Ibrahim Tencer / @ibrahimtencer

02/16/2012 at 04:48AM

21
#45 - arno renevier / @dadadiblog

03/18/2012 at 03:48PM

21
#46 - Garry Shutler / @gshutler

03/31/2012 at 06:39PM

21
#47 - Nolen Royalty / @NolenRoyalty

04/22/2012 at 03:21AM

21
#48 - Kerson Hsiao / @KersonHsiao

05/06/2012 at 04:49PM

21
#49 - Andrew D. Wong / @andrewdwong

07/16/2012 at 05:57PM

21
#50 - Oliver Mader / @dotb52

07/17/2012 at 07:15AM

21
#51 - Daniel S / @smatter0ne

07/17/2012 at 10:48PM

21
#52 - tmr / @tmr314

09/05/2012 at 10:41AM

21
#53 - Nathan / @boysetsfrog

10/20/2012 at 12:41PM

21
#54 - a24f0600 / @a24f0600

02/07/2013 at 01:55PM

21
#55 - Edgar Hipp / @EdgarHipp

11/14/2013 at 08:42PM

21
#56 - Joonas Pihlajamaa / @jokkebk

02/23/2014 at 09:52PM

21
#57 - Zapata / @Incredible_JFP

05/23/2014 at 10:46PM

21
#58 - Haoxuan Yue / @yuehaoxuanar

07/19/2014 at 02:10PM

21
#59 - Caek / @Caek_

08/19/2014 at 02:32AM

21
#60 - Matt / @mcr05

10/28/2014 at 08:51PM