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):
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 - 张文远 / @zhwenyuan

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

19
#17 - chocolate / @chocola81394123

11/24/2020 at 09:12AM

19
#18 - loupiot.veloce / @LoupiotVeloce

07/24/2022 at 09:49AM

19
#19 - Qing Liu / @poeminlash

07/30/2022 at 02:54AM

19
#20 - 刘宏亮 / @AkeyCoy

09/26/2022 at 04:55AM

19
#21 - Mrmclarrinson / @mrmclarrinson

12/13/2022 at 12:19PM

19
#22 - Golf Vim / @GolfVim11388

07/03/2023 at 02:16PM

19
#23 - Zion Park / @zionpark93

08/08/2023 at 03:11PM

19
#24 - Peppa Pig / @PeppaPigSg

06/02/2024 at 08:55AM

19
#25 - nickGPT / @nickandbro

08/28/2024 at 11:45PM

19
#26 - scpchicken / @scpchicken

09/10/2024 at 03:08AM

19
#27 - Tsimon Dorakh / @Tsimon-Dorakh

11/10/2024 at 11:21AM

20
#28 - Marcin Szamotulski / @me_coot

10/12/2013 at 05:41PM

20
#29 - Brendan B Amdocs / @AmdocsB

10/31/2018 at 04:31PM

20
#30 - Michel Viktor / @tomkpz

07/31/2021 at 04:38AM