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

592 active golfers, 1852 entries

Leaderboard (lowest score wins):
13
#361 - Janine Cheng / @janineist

02/12/2016 at 05:56PM

13
#362 - hardaudit / @hardaudit

02/24/2016 at 04:36PM

13
#363 - André Peric Tavares / @AndrePeric

07/31/2016 at 02:13PM

13
#364 - Jeremiah Goyette / @JeremiahGoyette

08/02/2016 at 06:11AM

13
#365 - 王运 / @640138017

09/01/2016 at 04:55AM

13
#366 - Michał Dytko / @DytkoM

12/22/2016 at 01:44PM

13
#367 - Jakob / @jajob

04/01/2017 at 06:20PM

13
#368 - Florian Gauger / @FlorianGauger

06/05/2017 at 05:17PM

13
#369 - MS / @schrectacular

06/09/2017 at 04:39PM

13
#370 - Dominic Z / @thammaaa

02/01/2018 at 12:54PM

13
#371 - Paul Draghicescu / @pdragy

03/27/2018 at 02:53PM

13
#372 - Luke Lee / @luke0201

05/06/2018 at 09:10AM

13
#373 - aaa1195 / @aaa11954

08/07/2018 at 06:00PM

13
#374 - albalitz / @_albalitz

06/06/2019 at 01:07PM

14
#375 - Jacob Vosmaer / @jacobvosmaer

06/04/2012 at 07:53PM

14
#376 - Javier Blanco / @jbgutierrez

06/04/2012 at 10:53PM

14
#377 - captain_morgan / @captain_morgan

06/05/2012 at 09:17AM

14
#378 - Robin Landström / @R_Landstrom

06/06/2012 at 06:54PM

14
#379 - Dil / @dilpun

06/08/2012 at 12:44PM

14
#380 - Alex David / @alexd_me

06/13/2012 at 06:15PM

14
#381 - buz / @buzbone

06/15/2012 at 01:25AM

14
#382 - Nimlar / @Nimlar

06/15/2012 at 08:50AM

14
#383 - Carl Furrow / @carl_furrow

06/22/2012 at 06:12PM

14
#384 - Joe McCall / @joem86

07/02/2012 at 09:57PM

14
#385 - Marco / @xmarkoz

07/04/2012 at 06:13PM

14
#386 - Eric Mathison / @ericmathison

07/13/2012 at 07:38AM

14
#387 - Steve Burdick / @kairu0

07/22/2012 at 06:18AM

14
#388 - Caleb McDaniel / @wcaleb

07/25/2012 at 06:36PM

14
#389 - Dan Oneata / @DanOneata

08/04/2012 at 09:38AM

14
#390 - Jacob Taylor / @jacobltaylor

08/05/2012 at 02:41AM