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

Switch function arguments

How to switch two arguments of a function.

Start file
function testFunction (foo, bar) {
}
End file
function testFunction (bar, foo) {
}

View Diff

1c1
< function testFunction (foo, bar) {
---
> function testFunction (bar, foo) {

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 434 remaining solutions by signing in and submitting your own entry
#435 juan patlang / juanpatlang - Score: 15 - 08/23/12 @ 08:57
5edt)bibar, <Esc>ZZ

0 comments


#436 Ori Kremer / orikr - Score: 15 - 08/28/12 @ 20:35
f(abar, <Esc>f,deZZ

0 comments


#437 Arto Vuori / dhpe - Score: 15 - 08/31/12 @ 19:25
ffdtbea, <Esc>pxXZZ

0 comments


#438 Nicolas Friedli / NicolasFriedli - Score: 15 - 10/29/12 @ 16:50
fbdT(wi, foo<Esc>ZZ

0 comments


#439 Underhill Labs / underhilllabs - Score: 15 - 10/30/12 @ 04:38
f,dt)bibar, <Esc>ZZ

0 comments


#440 Adam Dratwinski / adwinsky - Score: 15 - 11/27/12 @ 19:46
ffdtbwi, foo<Esc>ZZ

0 comments


#441 Casey Robinson / rampant_monkey - Score: 15 - 12/05/12 @ 21:32
4wdt)bibar, <Esc>ZZ

0 comments


#442 Timothée Gauthier / zmf_tim - Score: 15 - 07/13/13 @ 06:31
ffdeebP<Right>deF(pZZ

0 comments


#443 fSchl / FelixSchlitter - Score: 15 - 07/15/13 @ 20:20
f,5xbibar, <Esc>:x<CR>

0 comments


#444 James / Dronak - Score: 15 - 08/29/13 @ 14:37
ffdw2xepafoo<Esc>ZZ

0 comments


#445 foo / foo88832727 - Score: 15 - 10/18/13 @ 20:04
f,xxd3hea, <Esc>pZZ

0 comments


#446 Chris Ford / ctford - Score: 15 - 10/20/13 @ 12:38
4wdt)bibar, <Esc>ZZ

0 comments


#447 mwcz / mwcz - Score: 15 - 11/01/13 @ 18:16
ffdwep7h2x2lpZZ

0 comments


#448 Mathieu Larouche / matdube - Score: 15 - 11/19/13 @ 11:41
ffibar, <Esc>f,5xZZ

0 comments


#449 Larry Boltovskoi / larrybolt - Score: 15 - 12/08/13 @ 01:40
3wywWvep3bvepZZ

0 comments


#450 Brian Peiris / brianpeiris - Score: 15 - 12/28/13 @ 05:49
ffibar, <Esc>f,deZZ

0 comments


#451 Johan Berg / _berg85 - Score: 15 - 01/24/14 @ 14:57
ffdtbea, foo<Esc>ZZ

0 comments


#452 Hyper Bovine / hyperbovine - Score: 15 - 01/29/14 @ 05:19
ffdtbea, foo<Esc>ZZ

0 comments


#453 mattsalacain / mattsalacain - Score: 15 - 02/04/14 @ 05:24
%ci)bar, foo<Esc>ZZ

0 comments


#454 Ben Lambeth / azy2_ben - Score: 15 - 02/13/14 @ 00:00
f(abar, <Esc>f,deZZ

0 comments


#455 Robert Siemieniec / rsiemieniec - Score: 15 - 03/12/14 @ 16:29
ff8sbar, foo<Esc>ZZ

0 comments


#456 Felipe Jaramillo F / mrfelipe - Score: 15 - 04/01/14 @ 21:32
f(abar, <Esc>f,deZZ

0 comments


#457 Lance Levine / LanceSMLevine - Score: 15 - 04/02/14 @ 05:18
ffdExwi, foo<Esc>ZZ

0 comments


#458 mathac / mathacgolf - Score: 15 - 05/05/14 @ 07:34
ffceb<C-N><Esc>wwPldwZZ

0 comments


#459 Victor Bjelkholm / VictorBjelkholm - Score: 15 - 06/02/14 @ 22:21
f(abar, <Esc>f,deZZ

0 comments


#460 Francisco García / SystematicFrank - Score: 15 - 06/24/14 @ 11:35
ffdtbwi, <Esc>pXxZZ

0 comments


#461 _ / klawh3 - Score: 15 - 07/12/14 @ 01:39
f(ldwwPldwBBpZZ

0 comments


#462 fa / twiteciop - Score: 15 - 08/07/14 @ 12:52
f(ldwlpldeF,PZZ

0 comments


#463 Tj / yrddy - Score: 15 - 08/13/14 @ 08:12
f(R(bar, foo<Esc>ZZ

0 comments


#464 Rolen Le / RolenTLe - Score: 15 - 09/26/14 @ 19:33
ffdtbea, foo<Esc>ZZ

0 comments


#465 Sabiki94@ブルスクの人 / _jptomoya - Score: 15 - 10/18/14 @ 07:47
ffdtbwi, foo<Esc>ZZ

0 comments


#466 SilentFl / Silent_Fl - Score: 15 - 01/27/15 @ 09:56
ffdf wi, <Esc>pxXZZ

0 comments


#467 d1uckym d1uckym / d1uckym - Score: 15 - 02/18/15 @ 20:13
f,dt)%abar, <Esc>ZZ

0 comments


#468 Wilmer Bandres / WilmerBandres - Score: 15 - 12/17/15 @ 18:34
ffi<C-N><C-N>, <Esc>f,dfrZZ

0 comments


#469 John Clara / johnanthclara - Score: 15 - 02/11/16 @ 00:08
ffdwlplvexbbpZZ

0 comments


#470 Andrew Krawchyk / krawchyk - Score: 15 - 02/28/16 @ 18:38
f)dFbF(pldwlpZZ

0 comments


#471 Jake Worth / jwworth - Score: 15 - 08/24/16 @ 01:07
f,dt)bibar, <Esc>ZZ

0 comments


#472 Mike Land / mikepland - Score: 15 - 08/24/16 @ 23:08
fbdwFfvwhpf pZZ

0 comments


#473 jack / jack28887741 - Score: 15 - 02/23/17 @ 10:58
ffdf ea, <Esc>pxXZZ

0 comments


#474 Thomas Noe / teh2mas - Score: 15 - 09/29/17 @ 17:32
ffdwephhdbF(pZZ

0 comments


#475 Asenar / asenar - Score: 16 - 06/08/12 @ 09:10
3wcwbar<Esc><Right><Right>p<Right>dwZZ

0 comments


#476 Omar Ramos / _omarramos - Score: 16 - 06/09/12 @ 04:23
f(ci(bar, foo<Esc>ZZ

0 comments


#477 Mario Forner / m_forner - Score: 16 - 06/18/12 @ 18:49
f,dbwPldwF,P:wq<CR>

0 comments


#478 Dan Masquelier / danmasq - Score: 16 - 06/19/12 @ 21:58
f,dt)bPa, <Esc>BXXZZ

0 comments


#479 Anouar ADLANI / aadlani - Score: 16 - 07/13/12 @ 23:05
f(ci(bar, foo<Esc>ZZ

0 comments


#480 Sebastian Korten / FlashKorten - Score: 16 - 07/14/12 @ 10:28
ffdwwPldwF,P<Esc>:x<CR>

0 comments


#481 Eric Söderström / eksoderstrom - Score: 16 - 07/18/12 @ 17:55
f(ldwllPldwBBpZZ

0 comments


#482 fyolnish / fyolnish - Score: 16 - 07/26/12 @ 01:17
3wdwwPldw2bp:wq<CR>

0 comments


#483 Petri Rosenström / wuzuuz - Score: 16 - 08/12/12 @ 09:48
ffdelpldeF,P:wq<CR>

0 comments


#484 Jason Bruce / jbrucenet - Score: 16 - 08/26/12 @ 17:48
ffibar, <Esc>f,dt)ZZ

0 comments


#485 Dragos Miron / capze - Score: 16 - 11/27/12 @ 20:07
f)cb<BS><BS><Esc>FfPa, <Esc>ZZ

0 comments


#486 James S.P. Barth / sp_barth - Score: 16 - 01/16/13 @ 21:29
3wdWea, foo<Esc>:wq<CR>

0 comments


#487 Niels Madan / nielsmadan - Score: 16 - 01/22/13 @ 21:13
f,ci(bar, foo<Esc>ZZ

0 comments


#488 Sam Phippen / samphippen - Score: 16 - 05/08/13 @ 20:47
f)ci)bar, foo<Esc>ZZ

0 comments


#489 Alexey / kramar42 - Score: 16 - 07/04/13 @ 12:50
ffibar, <Esc>f,5x:x<CR>

0 comments


#490 Aaron Bieber / aaronbieber - Score: 16 - 07/15/13 @ 21:52
f(abar, <Esc>f,dt)ZZ

0 comments


#491 Dr Rev J. '𝕵. 𝕶𝖎𝖗𝖈𝖍𝖆𝖗𝖙𝖟' Kirchartz / JKirchartz - Score: 16 - 07/25/13 @ 03:05
ff3xfrpFb3xF(pZZ

0 comments


#492 Sami Niiranen / saminiir - Score: 16 - 10/13/13 @ 10:57
f(ldwmmwvep`mPZZ

0 comments


#493 Toam / Toam - Score: 16 - 12/20/13 @ 23:47
ffci)bar, foo<Esc>ZZ

0 comments


#494 Aaron Burrow / WillFapForFood - Score: 16 - 01/18/14 @ 12:54
ffdtbea, <Esc>pxhxZZ

0 comments


#495 Jacob / jayekub - Score: 16 - 03/23/14 @ 20:18
f(abar, <Esc>f,dt)ZZ

0 comments


#496 Anders Hovgaard / akhovg - Score: 16 - 03/23/14 @ 22:55
f(abar, <Esc>f,dfrZZ

0 comments


#497 skensell / skensell - Score: 16 - 04/27/14 @ 08:48
ffci(bar, foo<Esc>ZZ

0 comments


#498 Subhi Dweik / SubhiDweik - Score: 16 - 06/02/14 @ 23:40
\ffdwepbdtfF(pZZ

0 comments


#499 r. / rmarvie - Score: 16 - 12/19/14 @ 21:41
f(ci)bar, foo<Esc>ZZ

0 comments


#500 ɐʇnɥsɐpoʇ / todashuta - Score: 16 - 03/25/15 @ 13:55
f,ci)bar, foo<Esc>ZZ

0 comments


#501 ɹǝsnɐɥsıʇnɹ uoɾ / JonRutis - Score: 16 - 06/16/15 @ 19:11
f)ci)bar, foo<Esc>ZZ

0 comments


#502 Tran Duc Thang / thangtd90 - Score: 16 - 03/06/16 @ 08:36
f(abar, <Esc>f,2dwZZ

0 comments


#503 Ryan van Rensburg / rdvr001 - Score: 16 - 07/23/16 @ 09:29
ffdwwPkldt)F,PZZ

0 comments


#504 carbonscott / wangimagine - Score: 16 - 08/23/16 @ 04:16
ffd2wepFfdwlp:x<CR>

0 comments


#505 Jon E. Eguiluz / viroide - Score: 16 - 02/24/17 @ 11:27
fbdw%pa, <Esc>el2xZZ

0 comments


#506 James Cash / jamesnvc - Score: 17 - 06/04/12 @ 18:29
ff"adwwdw"aPF(pZZ

0 comments


#507 Endri Runa / endiruna - Score: 17 - 06/10/12 @ 15:15
f,dblpldeF,P<Esc>:wq<CR>

0 comments


#508 emmanuel delgado / chischaschos - Score: 17 - 06/22/12 @ 17:11
ffvwlxwi, <Esc>ph2xZZ

0 comments


#509 Dave Aitken / actionshrimp - Score: 17 - 08/27/13 @ 18:43
<CR>f(abar, <Esc>f,dt)ZZ

0 comments


#510 wilddog64 / chengkai318 - Score: 17 - 12/17/13 @ 18:56
3Wdw%pa, <Esc>f,dt)ZZ

0 comments


#511 nope / nope_gknobup - Score: 17 - 03/01/15 @ 23:28
ffdawtbpldt)F(pZZ

0 comments


#512 Jonas Ng / jnshey - Score: 17 - 05/15/15 @ 16:08
ffdf ea, <C-R>"<Esc>hxxZZ

0 comments


#513 Henrik Lindgren / HeLi8one - Score: 17 - 05/17/15 @ 19:49
ffcwbar<Esc>fbPlcw<Esc>ZZ

0 comments


#514 William I. Olojede / williamolojede - Score: 17 - 05/27/18 @ 17:05
ffdt,fbPldt)F,PZZ

0 comments


#515 赤佐田奈葉 / akasatanaha_ - Score: 17 - 06/19/18 @ 04:51
wwabar, <Esc>wwdwdwZZ

0 comments


#516 Christopher Biscardi / chrisbiscardi - Score: 18 - 07/17/12 @ 07:21
3Wdwi<BS><BS><Esc>Bpa, <Esc>:wq<CR>

0 comments


#517 pikaren / REALpikaren - Score: 18 - 12/22/13 @ 09:28
ffdtbllpxXFra, <Esc>ZZ

0 comments


#518 David M / ohhhmandyyy - Score: 18 - 01/15/14 @ 23:24
ffdtbf)i, foo<Esc>:wq<CR>

0 comments


#519 Hannes Tydén / pht - Score: 18 - 08/08/14 @ 23:32
ffdtbwi, <C-C><C-C>pxhx:x<CR>

0 comments


#520 Mike Herrera / crftr - Score: 18 - 01/31/16 @ 22:43
ffcwbar<Esc>wwcwfoo<Esc>ZZ

0 comments


#521 Lajos Koszti / Ajnasz - Score: 19 - 06/04/12 @ 14:52
f(ldf wi, <Esc>phdt):x<CR>

0 comments


#522 Святослав Сюрин / rmrfhome - Score: 19 - 06/11/12 @ 13:16
f(wvedwPlvedbbp:wq<CR>

0 comments


#523 Zach Kemp / zvksf - Score: 19 - 12/18/13 @ 16:47
ffdwea, <Esc>pbbbblxxZZ

0 comments


#524 stb tra / stbtra - Score: 19 - 01/29/14 @ 05:16
/fo<CR>dwlp dwBBp<Esc>:wq<CR>

0 comments


#525 Feras / faldah - Score: 19 - 05/02/16 @ 02:07
t,diwt)pFrvhhdF(pZZ

0 comments


#526 Gurukandhamoorthi / Gurukandhamoor1 - Score: 19 - 07/11/17 @ 14:03
ff"fdt,fbPldfrF,PZZ

0 comments


#527 BartJanssen / BartJanssen - Score: 20 - 03/12/15 @ 22:06
ffdt,fra, <Esc>pF(ldl.ZZ

0 comments


#528 Philippe Creux / pcreux - Score: 21 - 07/13/12 @ 06:44
/fo<CR>2dwea, <Esc>phdt):wq<CR>

0 comments


#529 Artur Chruszcz / a_chru - Score: 21 - 09/15/13 @ 13:52
%%<Right>"xdiwdwep"xp:w<CR>:q<CR>

0 comments


#530 Alberto Pose / thepose - Score: 21 - 11/06/13 @ 18:04
fbdwF(pffdwt(<Esc>t)p<Esc><Esc>ZZ

0 comments


#531 Gowtham Madhava / gowthamgowtham - Score: 22 - 07/02/12 @ 16:54
ffdf,ea, <Esc>"<Esc><Esc><Esc>pxFb<Left>xZZ

0 comments


#532 Tyler Breisacher / tbreisacher - Score: 23 - 08/25/12 @ 07:40
t(llvlldt)phhi, <Esc>T(xxZZ

0 comments


#533 Howard / h0w412d - Score: 25 - 07/16/12 @ 02:53
:%s/foo, bar/bar, foo/<CR>ZZ

0 comments


#534 Korbinian Stoemmer / PaulSmecker - Score: 25 - 03/08/13 @ 13:15
wwldwwwPhhi, <Esc>WWBBBlxx<Esc>ZZ

0 comments


#535 DeusExHominis / DeusExHominis - Score: 25 - 02/18/15 @ 04:39
f(ldawwwpuPhhi, <C-Left><C-Left><BS><BS><Esc>:wq<CR>

0 comments


#536 Julian / JulianGindi - Score: 26 - 02/28/16 @ 18:39
f(ldwepbllli, <C-C><C-C>T,;hxx:wq<CR>

0 comments


#537 Noel Alejandro / noelrock333 - Score: 27 - 06/22/12 @ 23:03
3Wdw7hlplwjhhhkhhhdwlp:w<CR><C-W>q

0 comments


#538 Radu Bogdan Croitoru / dotx - Score: 27 - 02/21/14 @ 23:19
:%s/foo, bar/bar, foo/<CR>:wq<CR>

0 comments


#539 Dustin Willis Webber / Mephux - Score: 28 - 08/28/12 @ 16:29
:%s/foo\, bar/bar\, foo/g<CR>ZZ

0 comments


#540 JR Tashjian / jrtashjian - Score: 31 - 04/18/13 @ 17:49
:s:\(\w*\), \(\w*\):\2, \1<CR>:wq<CR>

0 comments


#541 Jan Wedekind / wedesoft - Score: 33 - 07/12/12 @ 21:43
:.s/\(...\), \(...\)/\2, \1/<CR>:wq<CR>

0 comments


#542 DK / scelerat - Score: 47 - 01/28/14 @ 19:51
:%s/\(<BS><BS>(\(<BS><BS>\(\w\+\), \(\w\+\))<BS>/(\2, \1/<CR>:wq<CR>

0 comments


#543 🎱 Josh Branchaud 🔥 / jbrancha - Score: 63 - 08/24/16 @ 01:02
:s<BS><BS>ffvi(:s/\w{3}, <BS><BS><BS><BS><BS><BS>(\w*\), \w<BS>(\w*\)\\2, <BS><BS><BS><BS><BS>/\2, \1/<CR>ZZ

0 comments


Created by: Ajnasz

543 active golfers, 1686 entries

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

06/04/2012 at 06:49PM

11
#2 - Conner McDaniel / connermcd

06/04/2012 at 09:07PM

11
#3 - Tim Chase / gumnos

06/05/2012 at 01:51AM

11
#4 - Justin Love / wondible

06/05/2012 at 02:53AM

11
#5 - Benoit Mortgat / Benoit_Mortgat

06/05/2012 at 05:21AM

11
#6 - Paul Gessler / pdgessler

06/07/2012 at 01:43AM

11
#7 - shutl_test / shutl_test

06/07/2012 at 12:34PM

11
#8 - utopiah / utopiah

06/08/2012 at 01:10PM

11
#9 - Drew Hannay / drewhannay

06/09/2012 at 06:55AM

11
#10 - Tibor Claassen / codebeige

06/09/2012 at 01:28PM

11
#11 - Joakim L. Engeset / joakim_eng

06/11/2012 at 05:17PM

11
#12 - David / ebonhand09

06/12/2012 at 02:20PM

11
#13 - Baylor Rae' / BaylorRae

06/12/2012 at 09:19PM

11
#14 - RusAlex Pletnev / RusAlexander

06/13/2012 at 06:44PM

11
#15 - Jacek Wysocki / ex00

06/14/2012 at 08:48AM

11
#16 - Rolf Bjaanes / rolfb

06/15/2012 at 01:59PM

11
#17 - noom narze / NarzE

06/18/2012 at 05:32AM

11
#18 - Federico Galassi / federicogalassi

06/18/2012 at 10:59PM

11
#19 - abernardes / abernardes

06/21/2012 at 03:55PM

11
#20 - Ryan O'Connell / Salshammath

06/21/2012 at 04:52PM

11
#21 - Miha Filej / mfilej

06/21/2012 at 05:23PM

11
#22 - mwatkward / AftrschoolSpe

06/22/2012 at 12:36PM

11
#23 - Alexander Washman / sanchous

07/07/2012 at 08:09AM

11
#24 - Wei Dai / clvv42

07/12/2012 at 08:33PM

11
#25 - Michael Eisel / michaeleisel

07/14/2012 at 02:44AM

11
#26 - wes / _weslly

07/19/2012 at 01:48AM

11
#27 - h_east (トロッコ6個) / h_east

07/19/2012 at 10:12AM

11
#28 - Paul Tarjan / ptarjan

07/29/2012 at 05:30PM

11
#29 - Ryan Patterson / CGamesPlay

07/29/2012 at 05:34PM

11
#30 - John Goalby / johngoalby

07/30/2012 at 09:38PM