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 73 remaining solutions by signing in and submitting your own entry
#74 Francisco Dibar / @frandibar - Score: 25 - 01/12/11 @ 19:49
9wyi":%d<CR>"0pqqYp<BS>xq11@qZZ

0 comments

#75 Mikel Ward / @mikelward - Score: 26 - 12/30/10 @ 04:19
d/H<CR>f"11Dqay^Pa<CR><Esc>k$q11@aZZ

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

#91 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

#92 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

92 active golfers, 212 entries

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

07/04/2012 at 09:59AM

19
#2 - Conner McDaniel / @connermcd

09/18/2012 at 09:26PM

19
#3 - Vim rocks / @vimrocks

10/09/2012 at 08:01AM

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

11/27/2012 at 06:26PM

19
#5 - Hubba / @HubbaBubbaFett

12/27/2012 at 11:06AM

19
#6 - Zach Kelling / @zeekay

02/23/2013 at 05:04AM

19
#7 - Trevor Powell / @DoomedBunnies

03/19/2013 at 10:05PM

19
#8 - wushexu / @wushexu

05/23/2013 at 12:26PM

19
#9 - Petro Тrouq / @zulolosi

06/12/2013 at 01:53PM

19
#10 - Spencer McAlpine / @spencermcalpine

02/11/2014 at 09:51AM

19
#11 - John Braxler / @braxler

07/30/2014 at 02:11PM

20
#12 - Marcin Sza / @coot_

10/12/2013 at 10:41AM

21
#13 - Matthew Draper / @_matthewd

12/30/2010 at 11:51PM

21
#14 - Prody / @Prody225

12/31/2010 at 11:51AM

21
#15 - Vincent Isambart / @vincentisambart

12/31/2010 at 04:29PM

21
#16 - h_east (DDD ready) / @h_east

01/02/2011 at 08:27AM

21
#17 - Johannes Martinsson / @moxiba

01/04/2011 at 08:52AM

21
#18 - Tim Chase / @gumnos

01/07/2011 at 12:56PM

21
#19 - drio / @drio

01/09/2011 at 09:38AM

21
#20 - Toto l'haricot / @nico_le_terribl

01/09/2011 at 04:00PM

21
#21 - Mattiassich Ákos / @mattiassicha

01/10/2011 at 10:55AM

21
#22 - Andrey A. Ugolnik / @andreyugolnik

01/19/2011 at 12:40PM

21
#23 - xhtmlforum / @xhtmlforum

01/25/2011 at 12:06AM

21
#24 - Wesley Wong / @wesleymwwong

02/01/2011 at 12:36AM

21
#25 - Joost / @vlabakje

02/21/2011 at 08:27AM

21
#26 - Pasha Klets / @p01nt

02/25/2011 at 02:51AM

21
#27 - Paweu1kZ nbNeyIhH / @yUQlwsFpRSzxJFh

03/06/2011 at 04:57PM

21
#28 - Dragan Cvetinovic / @kawkafi

05/12/2011 at 02:13PM

21
#29 - Johan Sveholm / @rymdtjuren

06/30/2011 at 01:00AM

21
#30 - Sammasati / @sammasati0

07/16/2011 at 10:40AM

21
#31 - Dave / @zzdave13

07/29/2011 at 02:35AM

21
#32 - Tim Tsu / @vimgolfpunk

09/14/2011 at 02:44PM

21
#33 - William Dunand / @wdunand

11/28/2011 at 06:24PM

21
#34 - You-Siang Lin / @yslinnctu

12/01/2011 at 06:23PM

21
#35 - Xavier Nayrac / @lkdjiin

12/30/2011 at 06:11AM

21
#36 - Calvin Condon / @ccondon

01/31/2012 at 09:09PM

21
#37 - Renat Aksitov / @Korvin79

02/08/2012 at 04:49AM

21
#38 - Ibrahim Tencer / @ibrahimtencer

02/15/2012 at 08:48PM

21
#39 - arno renevier / @dadadiblog

03/18/2012 at 08:48AM

21
#40 - Garry Shutler / @gshutler

03/31/2012 at 11:39AM

21
#41 - Nolen Royalty / @NolenRoyalty

04/21/2012 at 08:21PM

21
#42 - Kerson Hsiao / @KersonHsiao

05/06/2012 at 09:49AM

21
#43 - Andrew D. Wong / @andrewdwong

07/16/2012 at 10:57AM

21
#44 - Oliver Mader / @dotb52

07/17/2012 at 12:15AM

21
#45 - Daniel S / @smatter0ne

07/17/2012 at 03:48PM

21
#46 - tmr / @tmr314

09/05/2012 at 03:41AM

21
#47 - Nathan / @boysetsfrog

10/20/2012 at 05:41AM

21
#48 - a24f0600 / @a24f0600

02/07/2013 at 05:55AM

21
#49 - Edgar Hipp / @EdgarHipp

11/14/2013 at 12:42PM

21
#50 - Joonas Pihlajamaa / @jokkebk

02/23/2014 at 01:52PM

21
#51 - Zapata / @Incredible_JFP

05/23/2014 at 03:46PM

21
#52 - Haoxuan Yue / @yuehaoxuanar

07/19/2014 at 07:10AM

21
#53 - Caek / @Caek_

08/18/2014 at 07:32PM

22
#54 - Fer Enaf / @0x00C0FFEE

12/30/2010 at 03:59AM

22
#55 - Wei Dai / @clvv42

12/30/2010 at 03:59AM

22
#56 - Ujjwol Lamichhane / @Ujjwol

12/30/2010 at 04:12AM

22
#57 - Adam Pohorecki / @apohorecki

12/30/2010 at 04:27AM

22
#58 - Gael / @darkael2

12/30/2010 at 04:37AM

22
#59 - Jordan Lewis / @JordanALewis

12/30/2010 at 10:29AM

22
#60 - oliboli / @oliboliboli

01/06/2011 at 03:43AM

22
#61 - Dan Masquelier / @danmasq

07/02/2011 at 10:03AM

22
#62 - r / @tricosahedron

01/13/2013 at 08:50AM

22
#63 - Tyler / @tylerbindon

04/04/2013 at 08:56PM

22
#64 - James / @Dronak

09/05/2013 at 02:54PM

22
#65 - Zach Kemp / @zvksf

12/23/2013 at 09:35AM

22
#66 - Nabi Studios / @Toribash

03/28/2014 at 03:28AM

22
#67 - kemar / @le_kemar

08/29/2014 at 09:44AM

23
#68 - William Hua / @attente

07/17/2011 at 05:57AM

23
#69 - Asmund Liseth / @Asmund_L

02/04/2013 at 09:20AM

23
#70 - RobertT / @techrt2050

08/27/2013 at 11:03PM

24
#71 - crater / @crater2150

03/15/2011 at 05:16PM

24
#72 - Tyler Breisacher / @tbreisacher

08/25/2012 at 02:14AM

24
#73 - Ingo / @ist3fani

06/08/2013 at 06:31AM

25
#74 - Francisco Dibar / @frandibar

01/12/2011 at 07:49PM

26
#75 - Mikel Ward / @mikelward

12/30/2010 at 04:19AM

26
#76 - Josh Weinberg / @jcweinberg

12/30/2010 at 07:53AM

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

02/23/2012 at 08:12AM

27
#78 - pcapriotti / @pcapriotti

01/01/2011 at 10:22AM

27
#79 - Mikael Gustavsson / @slvmnd

04/15/2011 at 04:18AM

29
#80 - Behnam Esfahbod / @zwnj

12/30/2010 at 05:33AM

29
#81 - uuu / @uu59

12/30/2010 at 10:07AM

29
#82 - bestform / @bestform

02/05/2011 at 01:35PM

29
#83 - Hu Junfeng / @junfeng

07/20/2011 at 05:22AM

29
#84 - Ashley Feniello / @AshleyFen

01/28/2012 at 10:56PM

30
#85 - Siegfried Idyll / @siegfriedidyll

07/04/2011 at 12:09PM

30
#86 - Jimmy McRascal / @JimmyMcRascal

07/16/2014 at 06:26PM

31
#87 - Julien Pivotto / @roidelapluie

03/17/2011 at 02:15PM

31
#88 - Gary Rennie / @TheGazler

08/01/2012 at 12:28PM

32
#89 - Guillaume Bonnoron / @gbonnoron

12/30/2010 at 07:22AM

33
#90 - Arto Vuori / @dhpe

09/01/2012 at 12:11PM

37
#91 - ovo / @prokrastinatsia

08/11/2012 at 06:05PM

151
#92 - Taras Parshenko / @Timestreched

04/30/2012 at 01:43PM