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):
18
#31 - Julius Pfrommer / @dlctr

03/02/2013 at 08:21PM

25
#32 - Marcin Szamotulski / @me_coot

12/04/2012 at 06:56PM

25
#33 - Aniket Schneider / @shaydwyrm

12/08/2012 at 07:25AM

25
#34 - Alan Kessler / @alankesslr

12/10/2012 at 06:45PM

25
#35 - Édouard M'tou / @DouardM

12/19/2012 at 03:02PM

25
#36 - Chris Trombley / @ctrombley

01/28/2013 at 05:44PM

25
#37 - Trevor Powell / @DoomedBunnies

04/11/2013 at 02:46AM

25
#38 - Bradd Szonye / @bszonye

07/13/2013 at 01:33AM

25
#39 - powertomato / @powertomato

07/22/2013 at 11:50AM

25
#40 - Dom Armstrong / @dom_cycleface

10/01/2013 at 01:04PM

25
#41 - Casey Dwyer / @caseydwyer

11/04/2013 at 04:30AM

25
#42 - US Dollar Price / @USDollarPrice

11/06/2013 at 07:03AM

25
#43 - João Paiva / @jgpaiva

01/31/2014 at 06:17PM

25
#44 - mark0829 / @mark0829

03/05/2015 at 06:24AM

25
#45 - pftb12345 / @pftb12345

04/11/2015 at 05:18PM

25
#46 - Clark DuVall / @theclarkatron

05/22/2015 at 06:21AM

25
#47 - Dimitar Dimitrov / @kurkale6ka

03/23/2016 at 02:58PM

25
#48 - Turkey Man / @lvturkeyman

11/26/2017 at 09:10AM

25
#49 - DHM / @DHM29978992

05/01/2018 at 01:51AM

25
#50 - Chester Yap / @Chest_ErYap

08/04/2019 at 04:52PM

29
#51 - N / @nymph192

02/11/2013 at 09:23PM

31
#52 - h_east (トロッコ6個) / @h_east

12/04/2012 at 01:20PM

31
#53 - Joel Elkins / @dice_tea

03/04/2013 at 04:34AM

31
#54 - Ram Tamtam / @ramtamtamtam

07/17/2014 at 10:19AM

32
#55 - じょんあば / @john_ababa

12/09/2012 at 10:26AM

32
#56 - banana / @sparkleseed

12/23/2012 at 05:18AM

32
#57 - Global Maquereau / @GlobalMaquereau

12/24/2012 at 12:53PM

32
#58 - Tobias Praetsch / @tpraetsch

02/17/2013 at 09:06PM

32
#59 - Tyler / @tylerbindon

04/03/2013 at 04:06AM

32
#60 - Justin / @justinjaffray

04/23/2013 at 04:45PM