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):
26
#91 - Mikel Ward / @mikelward

12/30/2010 at 12:19PM

26
#92 - Josh Weinberg / @jcweinberg

12/30/2010 at 03:53PM

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

02/23/2012 at 04:12PM

26
#94 - George Angelopoulos / @g_usermod

08/05/2016 at 09:54AM

27
#95 - pcapriotti / @pcapriotti

01/01/2011 at 06:22PM

27
#96 - Mikael Gustavsson / @slvmnd

04/15/2011 at 11:18AM

29
#97 - Behnam Esfahbod / @zwnj

12/30/2010 at 01:33PM

29
#98 - uuu / @uu59

12/30/2010 at 06:07PM

29
#99 - bestform / @bestform

02/05/2011 at 09:35PM

29
#100 - Hu Junfeng / @junfeng

07/20/2011 at 12:22PM

29
#101 - Ashley Feniello / @AshleyFen

01/29/2012 at 06:56AM

30
#102 - sidyll / @sidyll

07/04/2011 at 07:09PM

30
#103 - Jimmy McRascal / @JimmyMcRascal

07/17/2014 at 01:26AM

31
#104 - Julien Pivotto / @roidelapluie

03/17/2011 at 09:15PM

31
#105 - Gary Rennie / @TheGazler

08/01/2012 at 07:28PM

32
#106 - Guillaume Bonnoron / @gbonnoron

12/30/2010 at 03:22PM

32
#107 - Paul Schaefer / @schaeferpp

05/24/2019 at 03:26PM

33
#108 - Arto Vuori / @dhpe

09/01/2012 at 07:11PM

37
#109 - ovo / @prokrastinatsia

08/12/2012 at 01:05AM

119
#110 - Charlie OConor / @charlieoconor

09/06/2019 at 08:12PM

151
#111 - Taras Parshenko / @Timestreched

04/30/2012 at 08:43PM