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

589 active golfers, 1843 entries

Leaderboard (lowest score wins):
11
#31 - Frank Twitting / @knarfben

07/31/2012 at 02:03PM

11
#32 - 東 / @lldong

08/10/2012 at 07:28AM

11
#33 - Sean Griffin / @sgrif

08/13/2012 at 02:03AM

11
#34 - Aaron Miller / @apage43

08/13/2012 at 03:40AM

11
#35 - (Emile (Swarts)) / @EmileSwarts

08/18/2012 at 02:13PM

11
#36 - Joseph J. Piché / @jjpiche

08/26/2012 at 01:12AM

11
#37 - Sune Simonsen / @sunesimonsen

09/01/2012 at 09:30PM

11
#38 - Joe Nelson / @begriffs

09/03/2012 at 08:35PM

11
#39 - blat / @ferblape

09/10/2012 at 10:31AM

11
#40 - Son of Bongo / @bpcode

09/17/2012 at 03:02PM

11
#41 - Vim rocks / @vimrocks

10/07/2012 at 01:53PM

11
#42 - Trever Marshall / @dynamic_library

10/12/2012 at 07:19PM

11
#43 - Kate / @Arohanui

10/28/2012 at 04:01AM

11
#44 - makala noble / @mnoble01

11/13/2012 at 10:05AM

11
#45 - Drew Neil / @nelstrom

11/26/2012 at 11:19PM

11
#46 - Felix Ingram / @lllamaboy

11/27/2012 at 07:58PM

11
#47 - Tom Cammann / @tea_sea

11/27/2012 at 07:58PM

11
#48 - mattgibb / @mattgibb

11/27/2012 at 08:12PM

11
#49 - Tomasz Jureczko / @codehaha

11/27/2012 at 08:13PM

11
#50 - Hubba / @HubbaBubbaFett

12/10/2012 at 08:09PM

11
#51 - Yann Moisan / @YannMoisan

01/05/2013 at 11:54AM

11
#52 - Trevor Powell / @DoomedBunnies

03/21/2013 at 05:13AM

11
#53 - Adam Bell / @adamgbell

03/26/2013 at 05:25PM

11
#54 - Marco Hinz / @_mhinz_

05/21/2013 at 01:36PM

11
#55 - Tom User / @kiryph

05/30/2013 at 05:44PM

11
#56 - Petro Тrouq / @zulolosi

06/05/2013 at 08:37PM

11
#57 - Jonáš Šerých / @serycjon

06/25/2013 at 10:51PM

11
#58 - moo goo / @m00g000

07/01/2013 at 08:47PM

11
#59 - Gosteau Alexandre / @eclostene

07/04/2013 at 10:10AM

11
#60 - ———đίxίє—flαтlίиє——— / @_dixie_flatline

07/16/2013 at 05:35AM