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

589 active golfers, 1843 entries

Leaderboard (lowest score wins):
14
#421 - Patrick Pitoscia / @Patrick03960431

08/04/2014 at 11:38PM

14
#422 - Greg / @developergreg

09/08/2014 at 02:32AM

14
#423 - Justin Knag / @justinknag

09/13/2014 at 03:40PM

14
#424 - Malte R / @maltoe

11/07/2014 at 06:51PM

14
#425 - Aaron Whittington / @whittaaron

01/16/2015 at 03:29AM

14
#426 - ಸುಬ್ರಹ್ಮಣ್ಯ ಜೋಶಿ / @subbucoding

04/03/2015 at 08:42PM

14
#427 - William Ott / @oddalot

04/14/2015 at 08:33PM

14
#428 - Hendrik Lammers / @hendriklammers

05/09/2015 at 10:02AM

14
#429 - luffy / @raxcoi

06/06/2015 at 05:13PM

14
#430 - Elizabeth / @sprinkles418

07/29/2015 at 07:24PM

14
#431 - Endre Galaczi / @galacziendre

08/10/2015 at 03:11PM

14
#432 - Mateusz / @foobar98765

10/31/2015 at 05:43PM

14
#433 - abbystasja / @abbystasja

12/21/2015 at 11:49PM

14
#434 - retro / @tryphopp

01/10/2016 at 08:51AM

14
#435 - Cristian Lupașcu / @clupasq

02/17/2016 at 10:31AM

14
#436 - eL Gee / @LauranceEl

02/29/2016 at 12:32AM

14
#437 - glepha / @glepha_vim

03/10/2016 at 05:11AM

14
#438 - Bogumił Kamiński / @BogumilKaminski

05/01/2016 at 09:31PM

14
#439 - Chris Armstrong / @ChrisATweets

06/08/2016 at 07:16PM

14
#440 - Tom McHenry / @tommchenry

08/24/2016 at 12:57AM

14
#441 - И К / @igorjan94

09/15/2016 at 08:18AM

14
#442 - Kyouma / @kyoumaJohn

10/14/2016 at 06:31PM

14
#443 - Dillon Kearns / @dillontkearns

12/12/2016 at 05:39AM

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

04/14/2017 at 10:55AM

14
#445 - Edouard Piette / @EdPiette

05/11/2017 at 11:44AM

14
#446 - Sam Ringleman / @theRingleman

09/29/2017 at 05:39PM

14
#447 - Petar Saulic / @gorillawarfare9

10/27/2017 at 12:20PM

14
#448 - Geoff / @RealGeoffErwin

12/18/2017 at 08:27PM

14
#449 - hails3 / @hails33

05/28/2018 at 04:23PM

14
#450 - Viktor Voronin / @voroninman

08/22/2018 at 09:36AM