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):
12
#211 - Nathan / @NathanHarperoni

08/04/2013 at 05:47PM

12
#212 - Raphaël Saunier / @RaphaelSaunier

08/27/2013 at 06:58PM

12
#213 - Ed Zukowski / @dataoverflow

08/27/2013 at 07:15PM

12
#214 - David Escribano / @DavidEGx

08/27/2013 at 07:23PM

12
#215 - hiding / @I_haveno_name

10/01/2013 at 11:49AM

12
#216 - newton / @newtonsmartt

10/15/2013 at 07:17PM

12
#217 - Casey Dwyer / @caseydwyer

10/24/2013 at 03:04PM

12
#218 - bunnies president / @bunnies4p

10/25/2013 at 05:51PM

12
#219 - thasso / @thasso23

10/27/2013 at 06:48PM

12
#220 - US Dollar Price / @USDollarPrice

11/04/2013 at 06:09AM

12
#221 - gary.klindt@googlema / @garstekli

11/14/2013 at 09:05PM

12
#222 - Daniel Marjenburgh / @dmarjenburgh

11/17/2013 at 02:32PM

12
#223 - D / @justcallmedrago

12/17/2013 at 08:37AM

12
#224 - Eric Potter / @pottereric

12/19/2013 at 04:23PM

12
#225 - Andreas Källberg / @Anka213

01/17/2014 at 01:41AM

12
#226 - Rasmus P / @rasmup

01/25/2014 at 12:02AM

12
#227 - João Paiva / @jgpaiva

01/29/2014 at 07:32PM

12
#228 - Nikolay Frantsev / @Shutnik

02/04/2014 at 08:12AM

12
#229 - RB / @powerage88

03/18/2014 at 10:30PM

12
#230 - Strabs / @artistavenue

03/21/2014 at 03:06PM

12
#231 - ryk / @rykarn

03/29/2014 at 01:39PM

12
#232 - Jeff / @just_geophree

03/30/2014 at 03:36AM

12
#233 - Yiyang Chen / @yiyangc91

04/01/2014 at 01:46PM

12
#234 - 土ヤ / @ttsuchiya

04/27/2014 at 09:49AM

12
#235 - Marcelo Montu / @_mMontu_

06/24/2014 at 04:13PM

12
#236 - John Meisner / @jmeisned

06/25/2014 at 07:55PM

12
#237 - James Scriven / @JamesDScriven

07/12/2014 at 11:53AM

12
#238 - kwa / @kwa129

07/13/2014 at 07:39AM

12
#239 - Michi Loro / @michiloro

07/21/2014 at 10:48AM

12
#240 - Kai Wood / @kwd_io

07/27/2014 at 03:20PM