Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Leaderboard, 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 71 remaining solutions by signing in and submitting your own entry
#72 Mikel Ward / @mikelward - Score: 26 - 12/30/10 @ 04:19
d/H<CR>f"11Dqay^Pa<CR><Esc>k$q11@aZZ

0 comments

#73 Josh Weinberg / @jcweinberg - Score: 26 - 12/30/10 @ 07:53
/H<CR>yf!ggPlvGdqqYP$xq11@qZZ

0 comments

#74 無ん垢の叫び / @john_ababa - Score: 26 - 02/23/12 @ 08:12
v/"<CR>dnvGdY12PqalDjlq12@aZZ

0 comments

#75 pcapriotti / @pcapriotti - Score: 27 - 01/01/11 @ 10:22
jjf"yi"gg"_dGpqqYP$xq11@qZZ

0 comments

#76 Mikael Gustavsson / @slvmnd - Score: 27 - 04/15/11 @ 04:18
d/H<CR>"ayt"dG"aPqqYP$xq11@QZZ

0 comments

#77 Behnam Esfahbod / @zwnj - Score: 29 - 12/30/10 @ 05:33
cGHello, world!<Esc>q1YP$xq11@1ZZ

0 comments

#78 uuu / @uu59 - Score: 29 - 12/30/10 @ 10:07
cGHello, world!<Esc>qaYP$xq11@aZZ

0 comments

#79 bestform / @bestform - Score: 29 - 02/05/11 @ 13:35
cGHello, world!<Esc>qaYP$xq11@aZZ

0 comments

#80 Hu Junfeng / @hujunfeng - Score: 29 - 07/20/11 @ 05:22
cGHello, world!<Esc>qqYP$xq11@qZZ

0 comments

#81 Ashley Feniello / @AshleyFen - Score: 29 - 01/28/12 @ 22:56
d/H<NL>f"3d}yy12pk qqDj  q12@qZZ

0 comments

#82 Siegfried Idyll / @siegfriedidyll - Score: 30 - 07/04/11 @ 12:09
djjdGd4wxXXXf"DqaYP$xq13@adjZZ

0 comments

#83 Jimmy McRascal / @JimmyMcRascal - Score: 30 - 07/16/14 @ 18:26
/H<CR>yt"ggPlvGdqqYP$xq11@p11@qZZ

0 comments

#84 Julien Pivotto / @roidelapluie - Score: 31 - 03/17/11 @ 14:15
dGiHello, world!<Esc>qqyyP$xq11@qZZ

0 comments

#85 Gary Rennie / @TheGazler - Score: 31 - 08/01/12 @ 12:28
VGcHello, world!<Esc>qayyP$xq11@aZZ

0 comments

#86 Guillaume Bonnoron / @gbonnoron - Score: 32 - 12/30/10 @ 07:22
13ccHello, world!<Esc>qqyyP$xq11@qZZ

0 comments

#87 Arto Vuori / @dhpe - Score: 33 - 09/01/12 @ 12:11
/H<CR>dt"ggPlDY12pklqqDjllq12@qjdGZZ

0 comments

#88 ovo / @prokrastinatsia - Score: 37 - 08/11/12 @ 18:05
9wcf"Vp<Esc>uuugg9wcf"Vp$xYk<Esc>G13@.u<C-U>g+:x<CR>

0 comments

#89 Taras Parshenko / @Timestreched - Score: 151 - 04/30/12 @ 13: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

89 active golfers, 204 entries

Leaderboard (lowest score wins):
Q6hrg93p4r3hn56thmd0_normal
19
#1 - Urtica dioica / @udioica

07/04/2012 at 09:59AM

40051_789281885907_29616532_44170636_2091417_n_normal
19
#2 - Conner McDaniel / @connermcd

09/18/2012 at 09:26PM

Af3be16bb6a6dc7c7061fecdcf97d56b_normal
19
#3 - Vim rocks / @vimrocks

10/09/2012 at 08:01AM

I3_normal
19
#4 - Adelar S. Queiróz / @adelarsq

11/27/2012 at 06:26PM

Default_profile_1_normal
19
#5 - Hubba / @HubbaBubbaFett

12/27/2012 at 11:06AM

17350f0029adc263997f9812deee55bb_normal
19
#6 - Zach Kelling / @zeekay

02/23/2013 at 05:04AM

Bunnies_normal
19
#7 - Trevor Powell / @DoomedBunnies

03/19/2013 at 10:05PM

3af28abaa88d5ed2b7b5e41e6f5d94f4_normal
19
#8 - wushexu / @wushexu

05/23/2013 at 12:26PM

0e620322b2c292d069fe93e27c081f9c_normal
19
#9 - Petro Тrouq / @zulolosi

06/12/2013 at 01:53PM

Default_profile_1_normal
19
#10 - Spencer McAlpine / @spencermcalpine

02/11/2014 at 09:51AM

3ubh7kcfj18s5m9erc6p_normal
20
#11 - Marcin Sza / @coot_

10/12/2013 at 10:41AM

E55df1cc7d5fdb4ae9bc2afcb9afe7e4_normal
21
#12 - Matthew Draper / @_matthewd

12/30/2010 at 11:51PM

Default_profile_5_normal
21
#13 - Prody / @Prody225

12/31/2010 at 11:51AM

E_normal
21
#14 - Vincent Isambart / @vincentisambart

12/31/2010 at 04:29PM

P1000007_normal
21
#15 - h_east (DDD ready) / @h_east

01/02/2011 at 08:27AM

512fisk_normal
21
#16 - Johannes Martinsson / @moxiba

01/04/2011 at 08:52AM

Ewbdmdtg_normal
21
#17 - Tim Chase / @gumnos

01/07/2011 at 12:56PM

29ed1f20888463b3b72bd9fed88a79b8_normal
21
#18 - drio / @drio

01/09/2011 at 09:38AM

Default_profile_1_normal
21
#19 - Toto l'haricot / @nico_le_terribl

01/09/2011 at 04:00PM

Default_profile_0_normal
21
#20 - Mattiassich Ákos / @mattiassicha

01/10/2011 at 10:55AM

Andrey_ugolnik_180x180_normal
21
#21 - Andrey A. Ugolnik / @andreyugolnik

01/19/2011 at 12:40PM

X_normal
21
#22 - xhtmlforum / @xhtmlforum

01/25/2011 at 12:06AM

A_normal
21
#23 - Wesley Wong / @wesleymwwong

02/01/2011 at 12:36AM

Foto_joost_normal
21
#24 - Joost / @vlabakje

02/21/2011 at 08:27AM

Bf67e4fda36d0524a11d23efffd23139_normal
21
#25 - Pasha Klets / @p01nt

02/25/2011 at 02:51AM

Default_profile_1_normal
21
#26 - Paweu1kZ nbNeyIhH / @yUQlwsFpRSzxJFh

03/06/2011 at 04:57PM

Ja_u_central_parku-mala_normal
21
#27 - Dragan Cvetinovic / @kawkafi

05/12/2011 at 02:13PM

Mn_normal
21
#28 - Johan Sveholm / @rymdtjuren

06/30/2011 at 01:00AM

Default_profile_1_normal
21
#29 - Sammasati / @sammasati0

07/16/2011 at 10:40AM

Uwe_horns_by_joao_normal
21
#30 - Dave / @zzdave13

07/29/2011 at 02:35AM

Default_profile_1_normal
21
#31 - Tim Tsu / @vimgolfpunk

09/14/2011 at 02:44PM

Default_profile_6_normal
21
#32 - William Dunand / @wdunand

11/28/2011 at 06:24PM

Gintoki_normal
21
#33 - You-Siang Lin / @yslinnctu

12/01/2011 at 06:23PM

Avatar_normal
21
#34 - Xavier Nayrac / @lkdjiin

12/30/2011 at 06:11AM

Fb_normal
21
#35 - Calvin Condon / @ccondon

01/31/2012 at 09:09PM

Default_profile_2_normal
21
#36 - Renat Aksitov / @Korvin79

02/08/2012 at 04:49AM

Allah-final_normal
21
#37 - Ibrahim Tencer / @ibrahimtencer

02/15/2012 at 08:48PM

Dadadi_normal
21
#38 - arno renevier / @dadadiblog

03/18/2012 at 08:48AM

7dabee1f-1985-4e99-830c-11ff4ed3e8dc_normal
21
#39 - Garry Shutler / @gshutler

03/31/2012 at 11:39AM

264327_10150230576896345_729061344_7523848_5517118_n_normal
21
#40 - Nolen Royalty / @NolenRoyalty

04/21/2012 at 08:21PM

4654945923_eb2c60ee5f_normal
21
#41 - Kerson Hsiao / @KersonHsiao

05/06/2012 at 09:49AM

7032adb9729271eadab6a3ffdc883f16_normal
21
#42 - Andrew D. Wong / @andrewdwong

07/16/2012 at 10:57AM

Default_profile_3_normal
21
#43 - Oliver Mader / @dotb52

07/17/2012 at 12:15AM

Ich_normal
21
#44 - Daniel S / @smatter0ne

07/17/2012 at 03:48PM

Default_profile_1_normal
21
#45 - tmr / @tmr314

09/05/2012 at 03:41AM

Default_profile_3_normal
21
#46 - Nathan / @boysetsfrog

10/20/2012 at 05:41AM

Default_profile_1_normal
21
#47 - a24f0600 / @a24f0600

02/07/2013 at 05:55AM

Ukbiytbe_normal
21
#48 - Edgar Hipp / @EdgarHipp

11/14/2013 at 12:42PM

Netti_pihlajo1_lthumb_normal
21
#49 - Joonas Pihlajamaa / @jokkebk

02/23/2014 at 01:52PM

Desktophintergrund03_normal
21
#50 - Zapata / @Incredible_JFP

05/23/2014 at 03:46PM

Default_profile_0_normal
21
#51 - Haoxuan Yue / @yuehaoxuanar

07/19/2014 at 07:10AM

Daruma_normal
22
#52 - Fer Enaf / @0x00C0FFEE

12/30/2010 at 03:59AM

Me-small_normal
22
#53 - Wei Dai / @clvv42

12/30/2010 at 03:59AM

The-milky-way-mardi-khola-007_normal
22
#54 - Ujjwol Lamichhane / @Ujjwol

12/30/2010 at 04:12AM

South_park_384x384_normal
22
#55 - Adam Pohorecki / @apohorecki

12/30/2010 at 04:27AM

Default_profile_5_normal
22
#56 - Gael / @darkael2

12/30/2010 at 04:37AM

N1353060027_30013425_5720_normal
22
#57 - Jordan Lewis / @JordanALewis

12/30/2010 at 10:29AM

Default_profile_5_normal
22
#58 - oliboli / @oliboliboli

01/06/2011 at 03:43AM

46a0320167ab007f0a98222e65c0f3b7_normal
22
#59 - Dan Masquelier / @danmasq

07/02/2011 at 10:03AM

63ea12c336780cb0b054d3a3fc359deb_normal
22
#60 - r / @tricosahedron

01/13/2013 at 08:50AM

7bbc92500a24e0892967c51a50f1ff8e_normal
22
#61 - Tyler / @tylerbindon

04/04/2013 at 08:56PM

Arcadia_avatar_normal
22
#62 - James / @Dronak

09/05/2013 at 02:54PM

Default_profile_4_normal
22
#63 - Zach Kemp / @zvksf

12/23/2013 at 09:35AM

Eaff7bcd702181c28fdbfc2ae7b5d8d2_normal
22
#64 - Nabi Studios / @Toribash

03/28/2014 at 03:28AM

William_normal
23
#65 - William Hua / @attente

07/17/2011 at 05:57AM

Gravatar_normal
23
#66 - Asmund Liseth / @Asmund_L

02/04/2013 at 09:20AM

Default_profile_3_normal
23
#67 - RobertT / @techrt2050

08/27/2013 at 11:03PM

Default_profile_6_normal
24
#68 - crater / @crater2150

03/15/2011 at 05:16PM

Red_and_yellow_hat_normal
24
#69 - Tyler Breisacher / @tbreisacher

08/25/2012 at 02:14AM

Default_profile_2_normal
24
#70 - Ingo / @ist3fani

06/08/2013 at 06:31AM

Default_profile_6_normal
25
#71 - Francisco Dibar / @frandibar

01/12/2011 at 07:49PM

Img_1097-1_normal
26
#72 - Mikel Ward / @mikelward

12/30/2010 at 04:19AM

Image_normal
26
#73 - Josh Weinberg / @jcweinberg

12/30/2010 at 07:53AM

Bc879469f279ee24b7fbdfad7c2216d9_normal
26
#74 - 無ん垢の叫び / @john_ababa

02/23/2012 at 08:12AM

Me_normal
27
#75 - pcapriotti / @pcapriotti

01/01/2011 at 10:22AM

Me_normal
27
#76 - Mikael Gustavsson / @slvmnd

04/15/2011 at 04:18AM

3d3c391e6138cd35b9f45402fb5b08a1_normal
29
#77 - Behnam Esfahbod / @zwnj

12/30/2010 at 05:33AM

Rabbit_128_normal
29
#78 - uuu / @uu59

12/30/2010 at 10:07AM

Avatar_normal
29
#79 - bestform / @bestform

02/05/2011 at 01:35PM

Avatar-small_normal
29
#80 - Hu Junfeng / @hujunfeng

07/20/2011 at 05:22AM

Ashleyf2.0_normal
29
#81 - Ashley Feniello / @AshleyFen

01/28/2012 at 10:56PM

Default_profile_3_normal
30
#82 - Siegfried Idyll / @siegfriedidyll

07/04/2011 at 12:09PM

Default_profile_4_normal
30
#83 - Jimmy McRascal / @JimmyMcRascal

07/16/2014 at 06:26PM

3db919543844bbe01b0612956c1a9fa1_normal
31
#84 - Julien Pivotto / @roidelapluie

03/17/2011 at 02:15PM

Avatar_normal
31
#85 - Gary Rennie / @TheGazler

08/01/2012 at 12:28PM

262672_2181022843522_1185476898_32666605_6393658_n_normal
32
#86 - Guillaume Bonnoron / @gbonnoron

12/30/2010 at 07:22AM

500daa18db33d9585335c991451ba992_normal
33
#87 - Arto Vuori / @dhpe

09/01/2012 at 12:11PM

Default_profile_2_normal
37
#88 - ovo / @prokrastinatsia

08/11/2012 at 06:05PM

Avatars.capa.ru.15_normal
151
#89 - Taras Parshenko / @Timestreched

04/30/2012 at 01:43PM