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 605 remaining solutions by signing in and submitting your own entry
#606 🎱 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

606 active golfers, 1888 entries

Leaderboard (lowest score wins):
14
#451 - Bogumił Kamiński / @BogumilKaminski

05/01/2016 at 09:31PM

14
#452 - Chris Armstrong / @ChrisATweets

06/08/2016 at 07:16PM

14
#453 - Tom McHenry / @tommchenry

08/24/2016 at 12:57AM

14
#454 - И К / @igorjan94

09/15/2016 at 08:18AM

14
#455 - Kyouma / @kyoumaJohn

10/14/2016 at 06:31PM

14
#456 - Dillon Kearns / @dillontkearns

12/12/2016 at 05:39AM

14
#457 - Миша Сорокин / @rafmikovi4

04/14/2017 at 10:55AM

14
#458 - Edouard Piette / @EdPiette

05/11/2017 at 11:44AM

14
#459 - Sam Ringleman / @theRingleman

09/29/2017 at 05:39PM

14
#460 - Petar Saulic / @gorillawarfare9

10/27/2017 at 12:20PM

14
#461 - Geoff / @RealGeoffErwin

12/18/2017 at 08:27PM

14
#462 - hails3 / @hails33

05/28/2018 at 04:23PM

14
#463 - Viktor Voronin / @voroninman

08/22/2018 at 09:36AM

14
#464 - Jeff / @sir_wiggles3

09/14/2018 at 12:23AM

14
#465 - Florent Jaby / @Floby

10/15/2018 at 12:34PM

14
#466 - Luis Rodriguez / @luisthecoder

11/15/2018 at 09:02PM

14
#467 - Phoon / @justflashhim

05/11/2019 at 02:54PM

14
#468 - José / @AngelGaldamez

09/02/2019 at 03:56AM

14
#469 - Ainsley McGrath / @whole_grainsley

01/29/2020 at 12:49AM

15
#470 - Aaron Lake / @aaronmlake

06/04/2012 at 03:06PM

15
#471 - Raphaël De Giusti / @raphdg

06/04/2012 at 03:14PM

15
#472 - John Whitley / @johnwhitley

06/04/2012 at 03:44PM

15
#473 - Benjamin Sergeant / @bsergean

06/05/2012 at 04:47AM

15
#474 - Dave / @zzdave13

06/10/2012 at 03:28PM

15
#475 - abonec / @abonec

06/11/2012 at 11:26AM

15
#476 - Josh Steiner / @josh_steiner

06/12/2012 at 01:19AM

15
#477 - Carlos Hernando / @chernando

06/13/2012 at 06:53PM

15
#478 - ise0615 / @ise0615

06/15/2012 at 05:38AM

15
#479 - Pandae / @psasqw

06/21/2012 at 06:44PM

15
#480 - Brandon Montgomery / @bmonty

06/23/2012 at 01:31PM