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):
20
#31 - Jean George / @JeanGeo20504212

06/15/2022 at 08:54AM

20
#32 - bounce114 / @bounce114

12/07/2024 at 06:56AM

21
#33 - Matthew Draper / @_matthewd

12/31/2010 at 07:51AM

21
#34 - Prody / @Prody225

12/31/2010 at 07:51PM

21
#35 - Vincent Isambart / @vincentisambart

01/01/2011 at 12:29AM

21
#36 - h_east (トロッコ6個) / @h_east

01/02/2011 at 04:27PM

21
#37 - Johannes Martinsson / @moxiba

01/04/2011 at 04:52PM

21
#38 - Tim Chase / @gumnos

01/07/2011 at 08:56PM

21
#39 - drio / @drio

01/09/2011 at 05:38PM

21
#40 - Toto l'haricot / @nico_le_terribl

01/10/2011 at 12:00AM

21
#41 - Mattiassich Ákos / @mattiassicha

01/10/2011 at 06:55PM

21
#42 - Andrey A. Ugolnik / @andreyugolnik

01/19/2011 at 08:40PM

21
#43 - xhtmlforum / @xhtmlforum

01/25/2011 at 08:06AM

21
#44 - Wesley Wong / @wesleymwwong

02/01/2011 at 08:36AM

21
#45 - Joost / @vlabakje

02/21/2011 at 04:27PM

21
#46 - Pavlo Klets / @p01nt

02/25/2011 at 10:51AM

21
#47 - Paweu1kZ nbNeyIhH / @yUQlwsFpRSzxJFh

03/07/2011 at 12:57AM

21
#48 - Dragan Cvetinovic / @kawkafi

05/12/2011 at 09:13PM

21
#49 - Johan Sveholm / @rymdtjuren

06/30/2011 at 08:00AM

21
#50 - Sammasati / @sammasati0

07/16/2011 at 05:40PM

21
#51 - Dave / @zzdave13

07/29/2011 at 09:35AM

21
#52 - Tim Tsu / @vimgolfpunk

09/14/2011 at 09:44PM

21
#53 - William Dunand / @wdunand

11/29/2011 at 02:24AM

21
#54 - You-Siang Lin / @yslinnctu

12/02/2011 at 02:23AM

21
#55 - Xavier Nayrac / @lkdjiin

12/30/2011 at 02:11PM

21
#56 - Calvin Condon / @ccondon

02/01/2012 at 05:09AM

21
#57 - Renat Aksitov / @Korvin79

02/08/2012 at 12:49PM

21
#58 - Ibrahim Tencer / @ibrahimtencer

02/16/2012 at 04:48AM

21
#59 - arno renevier / @dadadiblog

03/18/2012 at 03:48PM

21
#60 - Garry Shutler / @gshutler

03/31/2012 at 06:39PM