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):
15
#481 - Adam Dratwinski / @adwinsky

11/27/2012 at 07:46PM

15
#482 - Casey Robinson / @rampant_monkey

12/05/2012 at 09:32PM

15
#483 - Timothée Gauthier / @zmf_tim

07/13/2013 at 06:31AM

15
#484 - fSchl / @FelixSchlitter

07/15/2013 at 08:20PM

15
#485 - James / @Dronak

08/29/2013 at 02:37PM

15
#486 - foo / @foo88832727

10/18/2013 at 08:04PM

15
#487 - Chris Ford / @ctford

10/20/2013 at 12:38PM

15
#488 - mwcz / @mwcz

11/01/2013 at 06:16PM

15
#489 - Mathieu Larouche / @matdube

11/19/2013 at 11:41AM

15
#490 - Larry Boltovskoi / @larrybolt

12/08/2013 at 01:40AM

15
#491 - Brian Peiris / @brianpeiris

12/28/2013 at 05:49AM

15
#492 - Johan Berg / @_berg85

01/24/2014 at 02:57PM

15
#493 - Hyper Bovine / @hyperbovine

01/29/2014 at 05:19AM

15
#494 - mattsalacain / @mattsalacain

02/04/2014 at 05:24AM

15
#495 - Ben Lambeth / @azy2_ben

02/13/2014 at 12:00AM

15
#496 - Robert Siemieniec / @rsiemieniec

03/12/2014 at 04:29PM

15
#497 - Felipe Jaramillo F / @mrfelipe

04/01/2014 at 09:32PM

15
#498 - Lance Levine / @LanceSMLevine

04/02/2014 at 05:18AM

15
#499 - mathac / @mathacgolf

05/05/2014 at 07:34AM

15
#500 - Victor Bjelkholm / @VictorBjelkholm

06/02/2014 at 10:21PM

15
#501 - Francisco García / @SystematicFrank

06/24/2014 at 11:35AM

15
#502 - _ / @klawh3

07/12/2014 at 01:39AM

15
#503 - fa / @twiteciop

08/07/2014 at 12:52PM

15
#504 - Tj / @yrddy

08/13/2014 at 08:12AM

15
#505 - Rolen Le / @RolenTLe

09/26/2014 at 07:33PM

15
#506 - Sabiki94@ブルスクの人 / @_jptomoya

10/18/2014 at 07:47AM

15
#507 - SilentFl / @Silent_Fl

01/27/2015 at 09:56AM

15
#508 - d1uckym d1uckym / @d1uckym

02/18/2015 at 08:13PM

15
#509 - Wilmer Bandres / @WilmerBandres

12/17/2015 at 06:34PM

15
#510 - John Clara / @johnanthclara

02/11/2016 at 12:08AM