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 50bda7a73645b3000200004b

lamb had a little Mary

"Mary" and "lamb" are swapped. Unswap them. Fast as you can.

Start file
lamb had a little Mary,
Whose fleece was white as snow.
And everywhere that lamb went,
The Mary was sure to go.

It followed her to school one day,
Which was against the rule.
It made the children laugh and play,
To see a Mary at school.

And so the teacher turned it out,
But still it lingered near,
And waited patiently about,
Till lamb did appear.

"Why does the Mary love lamb so?"
The eager children cry.
"Why, lamb loves the Mary, you know."
The teacher did reply.
End file
Mary had a little lamb,
Whose fleece was white as snow.
And everywhere that Mary went,
The lamb was sure to go.

It followed her to school one day,
Which was against the rule.
It made the children laugh and play,
To see a lamb at school.

And so the teacher turned it out,
But still it lingered near,
And waited patiently about,
Till Mary did appear.

"Why does the lamb love Mary so?"
The eager children cry.
"Why, Mary loves the lamb, you know."
The teacher did reply.

View Diff

1c1
< lamb had a little Mary,
---
> Mary had a little lamb,
3,4c3,4
< And everywhere that lamb went,
< The Mary was sure to go.
---
> And everywhere that Mary went,
> The lamb was sure to go.
9c9
< To see a Mary at school.
---
> To see a lamb at school.
14c14
< Till lamb did appear.
---
> Till Mary did appear.
16c16
< "Why does the Mary love lamb so?"
---
> "Why does the lamb love Mary so?"
18c18
< "Why, lamb loves the Mary, you know."
---
> "Why, Mary loves the lamb, you know."

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 168 remaining solutions by signing in and submitting your own entry
#169 생각하자. / @infinitekh - Score: 121 - 12/11/12 @ 16:29
:%s/lamb/temmmmm<BS><BS><BS><BS><BS><BS><BS>tteemmpp/g<CR>:<Up><Left><Right><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS>Mary/lamb/g<CR>:<Up><Up><Left><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><BS><BS><Left><Left><Left><Left><Left><Left><Left><Left><BS><BS><BS><BS><BS><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right><Right>/Mary/g<CR>:wq<CR>

0 comments


Created by: @udioica

169 active golfers, 618 entries

Leaderboard (lowest score wins):
32
#61 - Nathan / @NathanHarperoni

06/01/2013 at 04:03AM

32
#62 - Andrew Crites / @ExplosionPills

09/14/2013 at 03:51AM

32
#63 - Domingue Justin / @_jdomingue

12/24/2013 at 04:51AM

32
#64 - Quota / @Quotad

01/31/2014 at 09:45AM

32
#65 - Joonas Pihlajamaa / @jokkebk

02/20/2014 at 10:54AM

32
#66 - Brian Olpin / @bolpin

03/29/2014 at 04:53AM

32
#67 - Graeme Smith / @InstaGraeme

06/08/2019 at 07:48PM

33
#68 - Martin Galpin / @MartinRGalpin

08/22/2015 at 10:35AM

33
#69 - Eran / @RedSponge

11/17/2024 at 11:01AM

34
#70 - Hubba / @HubbaBubbaFett

12/07/2012 at 08:59PM

34
#71 - Panupan S. / @lionpeal

01/17/2013 at 11:47PM

34
#72 - Kai Yuan / @kentyuan

02/22/2013 at 01:31AM

34
#73 - cj / @cj01101

08/08/2013 at 11:59AM

34
#74 - James / @Dronak

08/29/2013 at 03:34PM

34
#75 - Paul Federspiel / @parobalth

10/23/2013 at 09:04PM

34
#76 - Patrick Oscity / @der_padde

02/11/2014 at 02:00PM

34
#77 - eBrnd / @eBrnd

11/05/2014 at 09:23PM

34
#78 - Liam Thurston / @lthurston188

08/18/2015 at 05:42AM

34
#79 - Walker Boh / @walker_boh

10/14/2015 at 03:34PM

34
#80 - tPenguinLTG / @tpenguinltg

05/01/2016 at 11:13PM

34
#81 - Gurukandhamoorthi / @Gurukandhamoor1

07/22/2017 at 04:36PM

34
#82 - Rebecca V. / @rxbxccxv

05/08/2020 at 10:08AM

35
#83 - Asmund / @herrasbe

12/23/2012 at 11:47PM

35
#84 - Steven Herbst / @transistorman

02/25/2013 at 12:28AM

35
#85 - Nathan Fisher / @natbobc

03/16/2013 at 02:26AM

35
#86 - David Yan / @david_yan

04/18/2013 at 10:51AM

35
#87 - Bunwut Tson / @NbTson

09/01/2013 at 10:31PM

35
#88 - brett / @brettyukich

09/21/2013 at 08:35AM

35
#89 - T / @tea_sea

05/13/2014 at 08:40AM

35
#90 - Caek / @Caek_

07/07/2014 at 02:50AM