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):
14
#391 - Björn Holdt / @bholdt

08/10/2012 at 07:19PM

14
#392 - Michael Limiero / @michaellimiero

08/13/2012 at 11:54PM

14
#393 - Brian Chen / @betaveros

08/21/2012 at 08:43AM

14
#394 - Viswanath Sivakumar / @viswanathgs

08/30/2012 at 06:31PM

14
#395 - Rohith Ravi / @entombedvirus

08/30/2012 at 11:25PM

14
#396 - jakeroberts / @jakeroberts

09/07/2012 at 06:50AM

14
#397 - Andrew Honig / @AndyKHonig

09/09/2012 at 03:03AM

14
#398 - Miguel Sánchez / @miguelsr1987

10/02/2012 at 11:50AM

14
#399 - Leigh Bicknell / @LeighBicknell

10/09/2012 at 11:58AM

14
#400 - Zbigniew Siciarz / @zsiciarz

11/18/2012 at 08:27PM

14
#401 - Claudio Ortolina / @cloud8421

11/27/2012 at 08:02PM

14
#402 - nicolas bo / @thevegeta

12/06/2012 at 10:10AM

14
#403 - Tyler / @tylerbindon

04/02/2013 at 07:20AM

14
#404 - Jean Benoit / @jeanbenoit123

04/27/2013 at 01:13PM

14
#405 - Clinton シ / @iblamefish

05/11/2013 at 01:16PM

14
#406 - Joe Sullivan / @itsjoesullivan

06/19/2013 at 06:31AM

14
#407 - Justin Le / @mstk

07/24/2013 at 07:59AM

14
#408 - Bart of Denver / @bartofdenver

08/12/2013 at 02:08PM

14
#409 - Alexander / @usr_noid

08/22/2013 at 07:22AM

14
#410 - Luis Visintini / @lvisintini

08/27/2013 at 07:27PM

14
#411 - engy / @engydmw

09/02/2013 at 08:59PM

14
#412 - Fernando Axel Ellis / @Axel_Ellis

09/17/2013 at 02:59PM

14
#413 - Oliver Christ / @0liverChrist

09/25/2013 at 02:22PM

14
#414 - Billy Ripper / @dirtlamb5

10/15/2013 at 10:03PM

14
#415 - Pawel Ceranka / @pawelceranka

10/17/2013 at 11:04AM

14
#416 - dickbutt / @ryan_haynes

10/24/2013 at 10:17PM

14
#417 - Sam Burk / @smwbk

12/21/2013 at 04:28AM

14
#418 - ren / @wxoc

02/26/2014 at 01:59AM

14
#419 - Peter Strawson / @PeterStrawson

04/09/2014 at 03:41AM

14
#420 - ZorgroZ / @ZorgroZ

04/12/2014 at 03:23PM