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 626 remaining solutions by signing in and submitting your own entry
#627 🎱 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

627 active golfers, 1982 entries

Leaderboard (lowest score wins):
12
#211 - Javier Cervantes / @solojavier

09/05/2012 at 06:36PM

12
#212 - BostX / @BostX

09/06/2012 at 04:59PM

12
#213 - Joachim / @jodles89

09/12/2012 at 12:04AM

12
#214 - Domon / @Domon

09/12/2012 at 02:21AM

12
#215 - Édouard M'tou / @DouardM

10/09/2012 at 04:39PM

12
#216 - Dan Goldstein / @dggoldst

10/15/2012 at 06:38PM

12
#217 - Marcin Szamotulski / @me_coot

11/23/2012 at 09:53AM

12
#218 - Panupan S. / @lionpeal

01/11/2013 at 07:05PM

12
#219 - Kai Yuan / @kentyuan

02/21/2013 at 04:28PM

12
#220 - Sheila Sha / @5h31la5ha

02/23/2013 at 12:17PM

12
#221 - Justin / @justinjaffray

04/23/2013 at 08:03PM

12
#222 - Bradd Szonye / @bszonye

07/11/2013 at 07:54AM

12
#223 - Christopher Bahr / @bahrware

07/11/2013 at 07:12PM

12
#224 - Woojung Kim 김우중 / @_kimwz

07/12/2013 at 04:25AM

12
#225 - Nathan / @NathanHarperoni

08/04/2013 at 05:47PM

12
#226 - Raphaël Saunier / @RaphaelSaunier

08/27/2013 at 06:58PM

12
#227 - Ed Zukowski / @dataoverflow

08/27/2013 at 07:15PM

12
#228 - David Escribano / @DavidEGx

08/27/2013 at 07:23PM

12
#229 - hiding / @I_haveno_name

10/01/2013 at 11:49AM

12
#230 - newton / @newtonsmartt

10/15/2013 at 07:17PM

12
#231 - Casey Dwyer / @caseydwyer

10/24/2013 at 03:04PM

12
#232 - bunnies president / @bunnies4p

10/25/2013 at 05:51PM

12
#233 - thasso / @thasso23

10/27/2013 at 06:48PM

12
#234 - US Dollar Price / @USDollarPrice

11/04/2013 at 06:09AM

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

11/14/2013 at 09:05PM

12
#236 - Daniel Marjenburgh / @dmarjenburgh

11/17/2013 at 02:32PM

12
#237 - D / @justcallmedrago

12/17/2013 at 08:37AM

12
#238 - Eric Potter / @pottereric

12/19/2013 at 04:23PM

12
#239 - Andreas Källberg / @Anka213

01/17/2014 at 01:41AM

12
#240 - Rasmus P / @rasmup

01/25/2014 at 12:02AM