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

0 comments

#80 Adrien Canuel / @AdrienCanuel - Score: 25 - 11/20/14 @ 13:43
9wyi":%d<CR>"0pqqYP$xq11@qZZ

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

0 comments

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

98 active golfers, 232 entries

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

07/04/2012 at 04:59PM

19
#2 - Conner McDaniel / @connermcd

09/19/2012 at 04:26AM

19
#3 - Vim rocks / @vimrocks

10/09/2012 at 03:01PM

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

11/28/2012 at 02:26AM

19
#5 - Hubba / @HubbaBubbaFett

12/27/2012 at 07:06PM

19
#6 - Zach Kelling / @zeekay

02/23/2013 at 01:04PM

19
#7 - Trevor Powell / @DoomedBunnies

03/20/2013 at 05:05AM

19
#8 - wushexu / @wushexu

05/23/2013 at 07:26PM

19
#9 - Petro Тrouq / @zulolosi

06/12/2013 at 08:53PM

19
#10 - Spencer McAlpine / @spencermcalpine

02/11/2014 at 05:51PM

19
#11 - John Braxler / @braxler

07/30/2014 at 09:11PM

20
#12 - Marcin Sza / @coot_

10/12/2013 at 05:41PM

21
#13 - Matthew Draper / @_matthewd

12/31/2010 at 07:51AM

21
#14 - Prody / @Prody225

12/31/2010 at 07:51PM

21
#15 - Vincent Isambart / @vincentisambart

01/01/2011 at 12:29AM

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

01/02/2011 at 04:27PM

21
#17 - Johannes Martinsson / @moxiba

01/04/2011 at 04:52PM

21
#18 - Tim Chase / @gumnos

01/07/2011 at 08:56PM

21
#19 - drio / @drio

01/09/2011 at 05:38PM

21
#20 - Toto l'haricot / @nico_le_terribl

01/10/2011 at 12:00AM

21
#21 - Mattiassich Ákos / @mattiassicha

01/10/2011 at 06:55PM

21
#22 - Andrey A. Ugolnik / @andreyugolnik

01/19/2011 at 08:40PM

21
#23 - xhtmlforum / @xhtmlforum

01/25/2011 at 08:06AM

21
#24 - Wesley Wong / @wesleymwwong

02/01/2011 at 08:36AM

21
#25 - Joost / @vlabakje

02/21/2011 at 04:27PM

21
#26 - Pasha Klets / @p01nt

02/25/2011 at 10:51AM

21
#27 - Paweu1kZ nbNeyIhH / @yUQlwsFpRSzxJFh

03/07/2011 at 12:57AM

21
#28 - Dragan Cvetinovic / @kawkafi

05/12/2011 at 09:13PM

21
#29 - Johan Sveholm / @rymdtjuren

06/30/2011 at 08:00AM

21
#30 - Sammasati / @sammasati0

07/16/2011 at 05:40PM

21
#31 - Dave / @zzdave13

07/29/2011 at 09:35AM

21
#32 - Tim Tsu / @vimgolfpunk

09/14/2011 at 09:44PM

21
#33 - William Dunand / @wdunand

11/29/2011 at 02:24AM

21
#34 - You-Siang Lin / @yslinnctu

12/02/2011 at 02:23AM

21
#35 - Xavier Nayrac / @lkdjiin

12/30/2011 at 02:11PM

21
#36 - Calvin Condon / @ccondon

02/01/2012 at 05:09AM

21
#37 - Renat Aksitov / @Korvin79

02/08/2012 at 12:49PM

21
#38 - Ibrahim Tencer / @ibrahimtencer

02/16/2012 at 04:48AM

21
#39 - arno renevier / @dadadiblog

03/18/2012 at 03:48PM

21
#40 - Garry Shutler / @gshutler

03/31/2012 at 06:39PM

21
#41 - Nolen Royalty / @NolenRoyalty

04/22/2012 at 03:21AM

21
#42 - Kerson Hsiao / @KersonHsiao

05/06/2012 at 04:49PM

21
#43 - Andrew D. Wong / @andrewdwong

07/16/2012 at 05:57PM

21
#44 - Oliver Mader / @dotb52

07/17/2012 at 07:15AM

21
#45 - Daniel S / @smatter0ne

07/17/2012 at 10:48PM

21
#46 - tmr / @tmr314

09/05/2012 at 10:41AM

21
#47 - Nathan / @boysetsfrog

10/20/2012 at 12:41PM

21
#48 - a24f0600 / @a24f0600

02/07/2013 at 01:55PM

21
#49 - Edgar Hipp / @EdgarHipp

11/14/2013 at 08:42PM

21
#50 - Joonas Pihlajamaa / @jokkebk

02/23/2014 at 09:52PM

21
#51 - Zapata / @Incredible_JFP

05/23/2014 at 10:46PM

21
#52 - Haoxuan Yue / @yuehaoxuanar

07/19/2014 at 02:10PM

21
#53 - Caek / @Caek_

08/19/2014 at 02:32AM

21
#54 - Matthieu Crapet / @mcr05

10/28/2014 at 08:51PM

21
#55 - pftb12345 / @pftb12345

03/28/2015 at 05:32AM

21
#56 - Clark DuVall / @theclarkatron

05/25/2015 at 05:15AM

22
#57 - Fer Enaf / @0x00C0FFEE

12/30/2010 at 11:59AM

22
#58 - Wei Dai / @clvv42

12/30/2010 at 11:59AM

22
#59 - Ujjwol Lamichhane / @Ujjwol

12/30/2010 at 12:12PM

22
#60 - Adam Pohorecki / @apohorecki

12/30/2010 at 12:27PM

22
#61 - Gael / @darkael2

12/30/2010 at 12:37PM

22
#62 - Jordan Lewis / @JordanALewis

12/30/2010 at 06:29PM

22
#63 - oliboli / @oliboliboli

01/06/2011 at 11:43AM

22
#64 - Dan Masquelier / @danmasq

07/02/2011 at 05:03PM

22
#65 - r / @tricosahedron

01/13/2013 at 04:50PM

22
#66 - Tyler / @tylerbindon

04/05/2013 at 03:56AM

22
#67 - James / @Dronak

09/05/2013 at 09:54PM

22
#68 - Zach Kemp / @zvksf

12/23/2013 at 05:35PM

22
#69 - Nabi Studios / @Toribash

03/28/2014 at 10:28AM

22
#70 - kemar / @le_kemar

08/29/2014 at 04:44PM

22
#71 - Oliver Christ / @0liverChrist

05/22/2015 at 08:22PM

23
#72 - William Hua / @attente

07/17/2011 at 12:57PM

23
#73 - Asmund Liseth / @Asmund_L

02/04/2013 at 05:20PM

23
#74 - RobertT / @techrt2050

08/28/2013 at 06:03AM

23
#75 - Mariano Macchi / @mmacchif

04/02/2015 at 12:22AM

24
#76 - crater / @crater2150

03/16/2011 at 12:16AM

24
#77 - Tyler Breisacher / @tbreisacher

08/25/2012 at 09:14AM

24
#78 - Ingo / @ist3fani

06/08/2013 at 01:31PM

25
#79 - Francisco Dibar / @frandibar

01/13/2011 at 03:49AM

25
#80 - Adrien Canuel / @AdrienCanuel

11/20/2014 at 01:43PM

26
#81 - Mikel Ward / @mikelward

12/30/2010 at 12:19PM

26
#82 - Josh Weinberg / @jcweinberg

12/30/2010 at 03:53PM

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

02/23/2012 at 04:12PM

27
#84 - pcapriotti / @pcapriotti

01/01/2011 at 06:22PM

27
#85 - Mikael Gustavsson / @slvmnd

04/15/2011 at 11:18AM

29
#86 - Behnam Esfahbod / @zwnj

12/30/2010 at 01:33PM

29
#87 - uuu / @uu59

12/30/2010 at 06:07PM

29
#88 - bestform / @bestform

02/05/2011 at 09:35PM

29
#89 - Hu Junfeng / @junfeng

07/20/2011 at 12:22PM

29
#90 - Ashley Feniello / @AshleyFen

01/29/2012 at 06:56AM

30
#91 - Siegfried Idyll / @siegfriedidyll

07/04/2011 at 07:09PM

30
#92 - Jimmy McRascal / @JimmyMcRascal

07/17/2014 at 01:26AM

31
#93 - Julien Pivotto / @roidelapluie

03/17/2011 at 09:15PM

31
#94 - Gary Rennie / @TheGazler

08/01/2012 at 07:28PM

32
#95 - Guillaume Bonnoron / @gbonnoron

12/30/2010 at 03:22PM

33
#96 - Arto Vuori / @dhpe

09/01/2012 at 07:11PM

37
#97 - ovo / @prokrastinatsia

08/12/2012 at 01:05AM

151
#98 - Taras Parshenko / @Timestreched

04/30/2012 at 08:43PM