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):
16
#541 - James S.P. Barth / @sp_barth

01/16/2013 at 09:29PM

16
#542 - Niels Madan / @nielsmadan

01/22/2013 at 09:13PM

16
#543 - Sam Phippen / @samphippen

05/08/2013 at 08:47PM

16
#544 - Alexey / @kramar42

07/04/2013 at 12:50PM

16
#545 - Aaron Bieber / @aaronbieber

07/15/2013 at 09:52PM

16
#546 - Dr. Rev. J. "Paranoid Android" Kirchartz / @JKirchartz

07/25/2013 at 03:05AM

16
#547 - Sami Niiranen / @saminiir

10/13/2013 at 10:57AM

16
#548 - Toam / @Toam

12/20/2013 at 11:47PM

16
#549 - Aaron Burrow / @WillFapForFood

01/18/2014 at 12:54PM

16
#550 - Jacob / @jayekub

03/23/2014 at 08:18PM

16
#551 - Anders Hovgaard / @akhovg

03/23/2014 at 10:55PM

16
#552 - skensell / @skensell

04/27/2014 at 08:48AM

16
#553 - Subhi Dweik / @SubhiDweik

06/02/2014 at 11:40PM

16
#554 - r. / @rmarvie

12/19/2014 at 09:41PM

16
#555 - ɐʇnɥsɐpoʇ / @todashuta

03/25/2015 at 01:55PM

16
#556 - ɹǝsnɐɥsıʇnɹ uoɾ / @JonRutis

06/16/2015 at 07:11PM

16
#557 - Tran Duc Thang / @thangtd90

03/06/2016 at 08:36AM

16
#558 - Ryan van Rensburg / @rdvr001

07/23/2016 at 09:29AM

16
#559 - carbonscott / @wangimagine

08/23/2016 at 04:16AM

16
#560 - Jon E. Eguiluz / @viroide

02/24/2017 at 11:27AM

16
#561 - dorpo / @dorpo2

11/01/2018 at 10:30PM

16
#562 - Mike C / @StrixVariaXIX

04/22/2019 at 04:29PM

16
#563 - Chris G / @AboutThatThing

06/11/2019 at 07:28AM

17
#564 - James Cash / @jamesnvc

06/04/2012 at 06:29PM

17
#565 - Endri Runa / @endiruna

06/10/2012 at 03:15PM

17
#566 - emmanuel delgado / @chischaschos

06/22/2012 at 05:11PM

17
#567 - Dave Aitken / @actionshrimp

08/27/2013 at 06:43PM

17
#568 - wilddog64 / @chengkai318

12/17/2013 at 06:56PM

17
#569 - nope / @nope_gknobup

03/01/2015 at 11:28PM

17
#570 - Jonas Ng / @jnshey

05/15/2015 at 04:08PM