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 4d2482950947c63e260000b1

Word Blender

The insides of long words seem to have been run through the blender. Can you fix this famous tale, brave knight?

Start file
             A CUCITCENNOT YEKNAE IN KNIG
                    AUHTRR'S CRUOT

IT was in Wciwrak Cltsae taht I cmae asorcs the
cuoirus segnartr wohm I am gniog to tlak auobt.
He aetcarttd me by terhe tgnihs: his cidnad sticilpmiy,
his muolevras ftirailimay wtih aneicnt aomrr, and the
rsenluftses of his cnapmoy -- for he did all the tniklag.
We flel tehtegor, as msedot plpoee wlil, in the tial of
the hred taht was bnieg swohn tguorhh, and he at ocne
bagen to say tgnihs wcihh ietseretnd me. As he
teklad anolg, sltfoy, pltnasaely, flgniwoly, he semeed
to dfirt aawy ilbitpecrepmy out of tihs wlrod and tmie,
and itno smoe rtomee era and old fettogron crtnuoy;
and so he gllaudary wvoe scuh a slepl auobt me taht I
semeed to mvoe anomg the sretceps and swodahs and
dsut and mlod of a gary atiuqitny, hnidlog sceeph wtih
a rilec of it! Eltcaxy as I wluod saepk of my nseraet
panosrel fdneirs or eeimens, or my msot failimar
nrobhgies, he skope of Sir Brevidee, Sir Bros de
Ginas, Sir Lolecnuat of the Lkae, Sir Gahalad, and all
the oehtr gaert nemas of the Tlbae Rnuod -- and how
old, old, ulbakaepsny old and fedad and dry and
mtsuy and aneicnt he cmae to look as he wnet on!
Pltnesery he tenrud to me and siad, jsut as one mhgit
saepk of the wehtaer, or any oehtr common mettar.
End file
             A CONNECTICUT YANKEE IN KING
                    ARTHUR'S COURT

IT was in Warwick Castle that I came across the
curious stranger whom I am going to talk about.
He attracted me by three things: his candid simplicity,
his marvelous familiarity with ancient armor, and the
restfulness of his company -- for he did all the talking.
We fell together, as modest people will, in the tail of
the herd that was being shown through, and he at once
began to say things which interested me. As he
talked along, softly, pleasantly, flowingly, he seemed
to drift away imperceptibly out of this world and time,
and into some remote era and old forgotten country;
and so he gradually wove such a spell about me that I
seemed to move among the specters and shadows and
dust and mold of a gray antiquity, holding speech with
a relic of it! Exactly as I would speak of my nearest
personal friends or enemies, or my most familiar
neighbors, he spoke of Sir Bedivere, Sir Bors de
Ganis, Sir Launcelot of the Lake, Sir Galahad, and all
the other great names of the Table Round -- and how
old, old, unspeakably old and faded and dry and
musty and ancient he came to look as he went on!
Presently he turned to me and said, just as one might
speak of the weather, or any other common matter.

View Diff

1,2c1,2
<              A CUCITCENNOT YEKNAE IN KNIG
<                     AUHTRR'S CRUOT
---
>              A CONNECTICUT YANKEE IN KING
>                     ARTHUR'S COURT
4,26c4,26
< IT was in Wciwrak Cltsae taht I cmae asorcs the
< cuoirus segnartr wohm I am gniog to tlak auobt.
< He aetcarttd me by terhe tgnihs: his cidnad sticilpmiy,
< his muolevras ftirailimay wtih aneicnt aomrr, and the
< rsenluftses of his cnapmoy -- for he did all the tniklag.
< We flel tehtegor, as msedot plpoee wlil, in the tial of
< the hred taht was bnieg swohn tguorhh, and he at ocne
< bagen to say tgnihs wcihh ietseretnd me. As he
< teklad anolg, sltfoy, pltnasaely, flgniwoly, he semeed
< to dfirt aawy ilbitpecrepmy out of tihs wlrod and tmie,
< and itno smoe rtomee era and old fettogron crtnuoy;
< and so he gllaudary wvoe scuh a slepl auobt me taht I
< semeed to mvoe anomg the sretceps and swodahs and
< dsut and mlod of a gary atiuqitny, hnidlog sceeph wtih
< a rilec of it! Eltcaxy as I wluod saepk of my nseraet
< panosrel fdneirs or eeimens, or my msot failimar
< nrobhgies, he skope of Sir Brevidee, Sir Bros de
< Ginas, Sir Lolecnuat of the Lkae, Sir Gahalad, and all
< the oehtr gaert nemas of the Tlbae Rnuod -- and how
< old, old, ulbakaepsny old and fedad and dry and
< mtsuy and aneicnt he cmae to look as he wnet on!
< Pltnesery he tenrud to me and siad, jsut as one mhgit
< saepk of the wehtaer, or any oehtr common mettar.
---
> IT was in Warwick Castle that I came across the
> curious stranger whom I am going to talk about.
> He attracted me by three things: his candid simplicity,
> his marvelous familiarity with ancient armor, and the
> restfulness of his company -- for he did all the talking.
> We fell together, as modest people will, in the tail of
> the herd that was being shown through, and he at once
> began to say things which interested me. As he
> talked along, softly, pleasantly, flowingly, he seemed
> to drift away imperceptibly out of this world and time,
> and into some remote era and old forgotten country;
> and so he gradually wove such a spell about me that I
> seemed to move among the specters and shadows and
> dust and mold of a gray antiquity, holding speech with
> a relic of it! Exactly as I would speak of my nearest
> personal friends or enemies, or my most familiar
> neighbors, he spoke of Sir Bedivere, Sir Bors de
> Ganis, Sir Launcelot of the Lake, Sir Galahad, and all
> the other great names of the Table Round -- and how
> old, old, unspeakably old and faded and dry and
> musty and ancient he came to look as he went on!
> Presently he turned to me and said, just as one might
> speak of the weather, or any other common matter.

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 41 remaining solutions by signing in and submitting your own entry
#42 Dave / zzdave13 - Score: 71 - 07/24/11 @ 22:15
:%s/\v\w\zs(\w+)\ze\w/\=join(reverse(split(submatch(1),'\zs')),'')/g<NL>ZZ

0 comments

#43 Gabriel Barta / gbarta - Score: 71 - 12/03/11 @ 12:28
:%s/\w\zs\(\w*\)\ze\w/\=join(reverse(split(submatch(1),'\zs')),'')/g<CR>ZZ

gbarta: Frustrating to google about VIM rtl support and then find out it wasn't compiled into my copy :/

1 comment

#44 James / Dronak - Score: 71 - 09/05/13 @ 22:19
:%s/\w\zs\(\w*\)\ze\w/\=join(reverse(split(submatch(1),'\zs')),'')/g<CR>ZZ

0 comments

#45 Edwin Merkled / emacs_viper - Score: 75 - 01/05/11 @ 23:32
:%s/\v\w\zs\<BS>(\w+)\ze\w/\=join(reverse(split(subma<BS>atch(0),'\zs')),'')/g<CR>ZZ

0 comments

#46 Tim Chase / gumnos - Score: 87 - 01/05/11 @ 15:57
:%s/\v(\w)(\w{2,})(\w)/\=submatch(1).join(reverse(split(<C-F>Asu<C-P>(2),'\zs')),'').s<C-P>(3)/g<CR>ZZ

gumnos: This is (more-or-less) what I used to make the challenge.

1 comment

#47 Gavin Gilmour / vesech - Score: 93 - 01/05/11 @ 16:49
:%s/\v(\w)(\w+)(\w)/\=submatch(1).join(reverse(split(submatch(2),'\zs')),'').submatch(3)/g<CR>ZZ

0 comments

#48 Dan Dorman / dandorman - Score: 93 - 01/05/11 @ 22:52
:%s/\v(\w)(\w+)(\w)/\=submatch(1).join(reverse(split(submatch(2),'\zs')),'').submatch(3)/g<CR>ZZ

0 comments

#49 Kylan Robinson / kylan - Score: 98 - 01/09/11 @ 20:12
:%s/\(\w\)\(\w*\)\(\w\)/\=submatch(1).join(reverse(split(submatch(2),'\zs')),'').submatch(3)/g<CR>ZZZ

0 comments

#50 Mark Reed / markjreed - Score: 99 - 10/22/11 @ 23:16
:%s/\(\w\)\(\w\+\)\(\w\)/\=submatch(1).join(reverse(split(submatch(2),'\zs')),'').submatch(3)/g<CR>:x<CR>

0 comments

#51 Oliver Christ / 0liverChrist - Score: 417 - 10/22/13 @ 21:28
w:set revins<CR>qalvehdi<C-R>*<Esc>wq@aw@@@@ww@@w3w3@@w6@@ww@@w2@@ww@@ww14@aub@@@@ww@@@@ww@@@@@@@@@@www@@ww@@wwwwww@@ww@@@@ww@@@@@@www@@wwwb@@@@w@@@@@@wwww@@@@ww@@@@@@wwww@@@@w@@w@@w@@ww@@w@@@@@@ww@@@@w@@ww@@@@@@@@ww@@@@wwww@@@@@@w@@@@w@@w@@w@@wb@@w@@w@@w@@w@@ww@@@@w@@@@@@w@@www@@ww@@@@ww@@@@@@w@@www@@@@@@ww@@ww@@ww@@w@@ww@@ww@@ww@@wwww@@@@@@ww@@@@wwwwwww@@@www@@@@@@bw@awww@@w@@w@@wwww@@ww@@w@@www@@w@@ww@@@@ww@@wwwwb@@@@@@ZZ

0 comments

#52 無ん垢の叫び / john_ababa - Score: 1291 - 02/26/12 @ 07:51
dG:a!<CR>             A CONNECTICUT YANKEE IN KING<CR>                    ARTHUR'S COURT<CR><CR>IT was in Warwick Castle that I came across the<CR>curious stranger whom I am going to talk about.<CR>He attracted me by three things: his candid simplicity,<CR>his marvelous familiarity with ancient armor, and the<CR>restfulness of his company -- for he did all the talking.<CR>We fell together, as modest people will, in the tail of<CR>the herd that was being shown through, and he at once<CR>began to say things which interested me. As he<CR>talked along, softly, pleasantly, flowingly, he seemed<CR>to drift away imperceptibly out of this world and time,<CR>and into some remote era and old forgotten country;<CR>and so he gradually wove such a spell about me that I<CR>seemed to move among the specters and shadows and<CR>dust and mold of a gray antiquity, holding speech with<CR>a relic of it! Exactly as I would speak of my nearest<CR>personal friends or enemies, or my most familiar<CR>neighbors, he spoke of Sir Bedivere, Sir Bors de<CR>Ganis, Sir Launcelot of the Lake, Sir Galahad, and all<CR>the other great names of the Table Round -- and how<CR>old, old, unspeakably old and faded and dry and<CR>musty and ancient he came to look as he went on!<CR>Presently he turned to me and said, just as one might<CR>speak of the weather, or any other common matter.<CR><Esc><Esc>ZZ

0 comments

Created by: gumnos

52 active golfers, 118 entries

Leaderboard (lowest score wins):
28
#1 - Urtica dioica / udioica

07/04/2012 at 05:35PM

28
#2 - John Braxler / braxler

09/10/2014 at 06:14PM

29
#3 - Petro Тrouq / zulolosi

07/06/2013 at 06:34AM

30
#4 - dominique pellé / vimgolfisto

01/07/2011 at 07:30PM

33
#5 - Federico Galassi / federicogalassi

01/07/2011 at 05:26PM

34
#6 - derp derp / derp__

01/05/2011 at 05:29PM

34
#7 - Wei Dai / clvv42

01/07/2011 at 02:28AM

34
#8 - Ujjwol Lamichhane / Ujjwol

01/07/2011 at 10:52AM

34
#9 - h_east (トロッコ6個) / h_east

02/06/2011 at 08:16AM

34
#10 - Paweu1kZ nbNeyIhH / yUQlwsFpRSzxJFh

03/16/2011 at 07:13AM

34
#11 - Hu Junfeng / junfeng

07/29/2011 at 03:17PM

34
#12 - Justin Love / wondible

08/23/2011 at 02:21PM

34
#13 - You-Siang Lin / yslinnctu

12/01/2011 at 10:00AM

34
#14 - Renat Aksitov / Korvin79

02/18/2012 at 11:19AM

34
#15 - hiding / I_haveno_name

10/12/2013 at 11:54AM

34
#16 - Joonas Pihlajamaa / jokkebk

02/23/2014 at 09:28PM

34
#17 - Dario Avitabile / tutticapaci

09/05/2014 at 01:17PM

34
#18 - Jon Krause / jkrause314

04/30/2016 at 11:32PM

35
#19 - Balkoth / _Balkoth_

01/05/2011 at 05:58PM

35
#20 - Victor Vaile / victorv4_

01/06/2011 at 03:34AM

35
#21 - Stephen Morrow / yawmark

01/06/2011 at 04:13AM

35
#22 - lemming / darthlemming

01/20/2011 at 07:22AM

35
#23 - Kerson Hsiao / KersonHsiao

08/02/2012 at 09:10AM

36
#24 - Gael / darkael2

01/06/2011 at 12:13PM

36
#25 - Øystein Walle / oysteinwalle

07/09/2011 at 03:03PM

38
#26 - Francisco Dibar / frandibar

01/12/2011 at 04:45AM

40
#27 - Thedward the Edward / thedward

01/11/2011 at 06:18PM

41
#28 - Mattiassich Ákos / mattiassicha

01/05/2011 at 04:42PM

50
#29 - Matthew Draper / _matthewd

01/05/2011 at 03:56PM

50
#30 - vg / vimgolfer

03/02/2011 at 04:08PM

55
#31 - Patrick Oscity / der_padde

03/26/2014 at 07:59AM

56
#32 - aRkadeFR / aRkadeFR

10/08/2013 at 06:16PM

57
#33 - Karel Vervaeke / karel1980

01/06/2011 at 09:12AM

67
#34 - William Dunand / wdunand

11/16/2011 at 09:30AM

67
#35 - Trevor Powell / DoomedBunnies

12/09/2011 at 03:05AM

68
#36 - Israel Chauca F. / Raimondi

01/06/2011 at 01:32AM

69
#37 - Pete Johns / johnsyweb

01/05/2011 at 08:55PM

69
#38 - Clive Evans / swish_bob

01/17/2011 at 10:54PM

71
#39 - Jordan Lewis / JordanALewis

01/06/2011 at 09:06PM

71
#40 - aimee / sermoa

01/08/2011 at 12:43PM

71
#41 - drio / drio

01/17/2011 at 02:00PM

71
#42 - Dave / zzdave13

07/24/2011 at 10:15PM

71
#43 - Gabriel Barta / gbarta

12/03/2011 at 12:28PM

71
#44 - James / Dronak

09/05/2013 at 10:19PM

75
#45 - Edwin Merkled / emacs_viper

01/05/2011 at 11:32PM

87
#46 - Tim Chase / gumnos

01/05/2011 at 03:57PM

93
#47 - Gavin Gilmour / vesech

01/05/2011 at 04:49PM

93
#48 - Dan Dorman / dandorman

01/05/2011 at 10:52PM

98
#49 - Kylan Robinson / kylan

01/09/2011 at 08:12PM

99
#50 - Mark Reed / markjreed

10/22/2011 at 11:16PM

417
#51 - Oliver Christ / 0liverChrist

10/22/2013 at 09:28PM

1291
#52 - 無ん垢の叫び / john_ababa

02/26/2012 at 07:51AM