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):
13
#361 - Kiet Nguyen / @kietnguyen86

09/29/2015 at 02:46PM

13
#362 - Gerald Tilma / @GeraldTilma

10/19/2015 at 04:21AM

13
#363 - ORchard test / @BilboBrovall

10/26/2015 at 01:55PM

13
#364 - Árpád Krejczinger / @krarpi

11/09/2015 at 05:01PM

13
#365 - Bruno Vieira Costa / @bruno_vcosta

11/28/2015 at 09:21PM

13
#366 - I / @ForgetIt17

11/29/2015 at 04:46PM

13
#367 - fuck GFW / @ravishGFW

01/05/2016 at 05:14AM

13
#368 - TerribleTrioJoe / @terribletriojoe

02/09/2016 at 09:17PM

13
#369 - Janine Cheng / @janineist

02/12/2016 at 05:56PM

13
#370 - hardaudit / @hardaudit

02/24/2016 at 04:36PM

13
#371 - André Peric Tavares / @AndrePeric

07/31/2016 at 02:13PM

13
#372 - Jeremiah Goyette / @JeremiahGoyette

08/02/2016 at 06:11AM

13
#373 - 王运 / @640138017

09/01/2016 at 04:55AM

13
#374 - Michał Dytko / @DytkoM

12/22/2016 at 01:44PM

13
#375 - Jakob / @jajob

04/01/2017 at 06:20PM

13
#376 - Florian Gauger / @FlorianGauger

06/05/2017 at 05:17PM

13
#377 - MS / @schrectacular

06/09/2017 at 04:39PM

13
#378 - Dominic Z / @thammaaa

02/01/2018 at 12:54PM

13
#379 - Paul Draghicescu / @pdragy

03/27/2018 at 02:53PM

13
#380 - Luke Lee / @luke0201

05/06/2018 at 09:10AM

13
#381 - aaa1195 / @aaa11954

08/07/2018 at 06:00PM

13
#382 - albalitz / @_albalitz

06/06/2019 at 01:07PM

13
#383 - hokonch / @hokonch

12/22/2019 at 04:59PM

13
#384 - jake worth / @jwworth

01/29/2020 at 01:09AM

14
#385 - Jacob Vosmaer / @jacobvosmaer

06/04/2012 at 07:53PM

14
#386 - Javier Blanco / @jbgutierrez

06/04/2012 at 10:53PM

14
#387 - captain_morgan / @captain_morgan

06/05/2012 at 09:17AM

14
#388 - Robin Landström / @R_Landstrom

06/06/2012 at 06:54PM

14
#389 - Dil / @dilpun

06/08/2012 at 12:44PM

14
#390 - Alex David / @alexd_me

06/13/2012 at 06:15PM