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 110 remaining solutions by signing in and submitting your own entry
#111 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

111 active golfers, 279 entries

Leaderboard (lowest score wins):
21
#61 - pftb12345 / @pftb12345

03/28/2015 at 05:32AM

21
#62 - Clark DuVall / @theclarkatron

05/25/2015 at 05:15AM

21
#63 - kiou / @smallletterquu

12/05/2015 at 03:01AM

22
#64 - Fer Enaf / @0x00C0FFEE

12/30/2010 at 11:59AM

22
#65 - Wei Dai / @clvv42

12/30/2010 at 11:59AM

22
#66 - Ujjwol Lamichhane / @Ujjwol

12/30/2010 at 12:12PM

22
#67 - Adam Pohorecki / @apohorecki

12/30/2010 at 12:27PM

22
#68 - Gael / @darkael2

12/30/2010 at 12:37PM

22
#69 - Jordan Lewis / @JordanALewis

12/30/2010 at 06:29PM

22
#70 - oliboli / @oliboliboli

01/06/2011 at 11:43AM

22
#71 - Dan Masquelier / @danmasq

07/02/2011 at 05:03PM

22
#72 - r / @tricosahedron

01/13/2013 at 04:50PM

22
#73 - Tyler / @tylerbindon

04/05/2013 at 03:56AM

22
#74 - James / @Dronak

09/05/2013 at 09:54PM

22
#75 - Zach Kemp / @zvksf

12/23/2013 at 05:35PM

22
#76 - Nabi Studios / @Toribash

03/28/2014 at 10:28AM

22
#77 - kemar / @le_kemar

08/29/2014 at 04:44PM

22
#78 - Oliver Christ / @0liverChrist

05/22/2015 at 08:22PM

22
#79 - Gurukandhamoorthi / @Gurukandhamoor1

08/29/2017 at 03:22PM

23
#80 - William Hua / @attente

07/17/2011 at 12:57PM

23
#81 - Asmund / @herrasbe

02/04/2013 at 05:20PM

23
#82 - RobertT / @techrt2050

08/28/2013 at 06:03AM

23
#83 - Mariano Macchi / @mmacchif

04/02/2015 at 12:22AM

23
#84 - Cristian Lupașcu / @clupasq

04/15/2016 at 08:28PM

24
#85 - crater / @crater2150

03/16/2011 at 12:16AM

24
#86 - Tyler Breisacher / @tbreisacher

08/25/2012 at 09:14AM

24
#87 - Ingo / @ist3fani

06/08/2013 at 01:31PM

24
#88 - 블랙미디 9월내한해라🥺 / @hautass

02/01/2018 at 06:27AM

25
#89 - Francisco Dibar / @frandibar

01/13/2011 at 03:49AM

25
#90 - Adrien Canuel / @AdrienCanuel

11/20/2014 at 01:43PM