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

141 active golfers, 430 entries

Leaderboard (lowest score wins):
22
#91 - James / @Dronak

09/05/2013 at 09:54PM

22
#92 - Zach Kemp / @zvksf

12/23/2013 at 05:35PM

22
#93 - Nabi Studios / @Toribash

03/28/2014 at 10:28AM

22
#94 - kemar / @le_kemar

08/29/2014 at 04:44PM

22
#95 - Oliver Christ / @0liverChrist

05/22/2015 at 08:22PM

22
#96 - Gurukandhamoorthi / @Gurukandhamoor1

08/29/2017 at 03:22PM

22
#97 - Elliot Schemmel / @regulated

10/18/2024 at 09:31PM

23
#98 - William Hua / @attente

07/17/2011 at 12:57PM

23
#99 - Asmund / @herrasbe

02/04/2013 at 05:20PM

23
#100 - RobertT / @techrt2050

08/28/2013 at 06:03AM

23
#101 - Mariano Macchi / @mmacchif

04/02/2015 at 12:22AM

23
#102 - Cristian Lupașcu / @clupasq

04/15/2016 at 08:28PM

23
#103 - quemeraisc / @quemeraisc

05/24/2022 at 11:23AM

24
#104 - crater / @crater2150

03/16/2011 at 12:16AM

24
#105 - Tyler Breisacher / @tbreisacher

08/25/2012 at 09:14AM

24
#106 - Ingo / @ist3fani

06/08/2013 at 01:31PM

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

02/01/2018 at 06:27AM

25
#108 - Francisco Dibar / @frandibar

01/13/2011 at 03:49AM

25
#109 - Adrien Canuel / @AdrienCanuel

11/20/2014 at 01:43PM

25
#110 - RockerZZY / @rocker_zzy

06/01/2020 at 03:11PM

26
#111 - Mikel Ward / @mikelward

12/30/2010 at 12:19PM

26
#112 - Josh Weinberg / @jcweinberg

12/30/2010 at 03:53PM

26
#113 - じょんあば / @john_ababa

02/23/2012 at 04:12PM

26
#114 - George Angelopoulos / @g_usermod

08/05/2016 at 09:54AM

26
#115 - POSIX / @po6ix

02/02/2022 at 01:59PM

26
#116 - Benjamin / @BenjaminBashar

01/12/2023 at 02:54PM

27
#117 - pcapriotti / @pcapriotti

01/01/2011 at 06:22PM

27
#118 - Mikael Gustavsson / @slvmnd

04/15/2011 at 11:18AM

27
#119 - naomi (forgetful functor) / @fixedpointfae

03/29/2022 at 02:38AM

29
#120 - Behnam Esfahbod / @zwnj

12/30/2010 at 01:33PM