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 86 remaining solutions by signing in and submitting your own entry
#87 하읗 | 느개비 한문숙어 / hautass - Score: 24 - 02/01/18 @ 06:27
9wyi"<C-O>dG"0pqqYP$xq11@qZZ

0 comments


#88 Francisco Dibar / frandibar - Score: 25 - 01/13/11 @ 03:49
9wyi":%d<CR>"0pqqYp<BS>xq11@qZZ

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


#93 George Angelopoulos / g_usermod - Score: 26 - 08/05/16 @ 09:54
GoH<C-N>, w<C-N>!<Esc>kdHqqYP$xq11@qZZ

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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

0 comments


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


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

108 active golfers, 270 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

19
#12 - Jacob Steffler / jacobsteffler

10/27/2015 at 05:44AM

19
#13 - Jon Krause / jkrause314

01/30/2016 at 09:22AM

19
#14 - trx / trxdbg

10/18/2016 at 04:56AM

19
#15 - Turkey Man / lvturkeyman

12/16/2017 at 03:51PM

19
#16 - ParasamGateZero / ParasamGateZero

01/27/2018 at 06:00AM

20
#17 - Marcin Sza / coot_

10/12/2013 at 05:41PM

21
#18 - Matthew Draper / _matthewd

12/31/2010 at 07:51AM

21
#19 - Prody / Prody225

12/31/2010 at 07:51PM

21
#20 - Vincent Isambart / vincentisambart

01/01/2011 at 12:29AM

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

01/02/2011 at 04:27PM

21
#22 - Johannes Martinsson / moxiba

01/04/2011 at 04:52PM

21
#23 - Tim Chase / gumnos

01/07/2011 at 08:56PM

21
#24 - drio / drio

01/09/2011 at 05:38PM

21
#25 - Toto l'haricot / nico_le_terribl

01/10/2011 at 12:00AM

21
#26 - Mattiassich Ákos / mattiassicha

01/10/2011 at 06:55PM

21
#27 - Andrey A. Ugolnik / andreyugolnik

01/19/2011 at 08:40PM

21
#28 - xhtmlforum / xhtmlforum

01/25/2011 at 08:06AM

21
#29 - Wesley Wong / wesleymwwong

02/01/2011 at 08:36AM

21
#30 - Joost / vlabakje

02/21/2011 at 04:27PM