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 167 remaining solutions by signing in and submitting your own entry
#168 생각하자. / @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

168 active golfers, 609 entries

Leaderboard (lowest score wins):
44
#151 - Justin Knag / @justinknag

08/28/2014 at 01:04PM

44
#152 - Rolf Vreijdenberger / @3l33th4x0r

07/26/2017 at 07:51PM

44
#153 - c0llision / @sh3llcode

01/28/2018 at 02:16PM

44
#154 - k1mosabe / @k1mosabe

12/03/2024 at 06:30AM

46
#155 - Oliver Christ / @0liverChrist

09/25/2013 at 03:01PM

46
#156 - Joris / @CheeseAndChips

03/31/2024 at 08:27PM

48
#157 - Tj / @yrddy

08/19/2014 at 07:02AM

49
#158 - Chirag Tailor / @ctailor2

01/27/2014 at 07:25AM

50
#159 - shahanavaz m / @shahanavazm

04/05/2024 at 12:49AM

50
#160 - guyontristan / @guyontristan

10/20/2024 at 02:15PM

51
#161 - Pradeep Kumar 🇮🇳🇮🇳🇮🇳🇮🇱🇮🇱🇮🇱 / @pradeep6kumar

01/19/2013 at 04:00AM

57
#162 - wtnb / @_kenichirow

04/01/2013 at 05:10PM

58
#163 - Jurica / @Jurica34581259

12/11/2018 at 02:48PM

66
#164 - Toto l'haricot / @nico_le_terribl

12/26/2012 at 09:35AM

69
#165 - spike grobstein / @spike666

05/24/2013 at 09:31PM

69
#166 - Nick Pham / @NickPha69469570

02/08/2021 at 03:37PM

69
#167 - nickGPT / @nickandbro

08/28/2024 at 07:13PM

121
#168 - 생각하자. / @infinitekh

12/11/2012 at 04:29PM