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
#91 - Milind Ganjoo / @mganjoo

03/06/2014 at 11:44PM

11
#92 - Joonas Pihlajamaa / @jokkebk

03/19/2014 at 11:30AM

11
#93 - Chaitanya Desu / @ChaituNu

05/04/2014 at 10:26PM

11
#94 - Peeby Thirtyone / @peeby31

05/10/2014 at 11:44AM

11
#95 - kiho choi / @ArtStandAlone

06/08/2014 at 06:22AM

11
#96 - Robert Bruce / @therealrobru

06/11/2014 at 08:33PM

11
#97 - compiled wrong / @compiledwrong

06/22/2014 at 11:49PM

11
#98 - playalong / @playwithit42

07/08/2014 at 07:37PM

11
#99 - Chris Brown / @engineercyb

07/14/2014 at 06:22PM

11
#100 - Caek / @Caek_

07/17/2014 at 05:19AM

11
#101 - Dominik Szerszeń / @DominikSze

07/22/2014 at 01:13PM

11
#102 - LC / @leeren

08/09/2014 at 08:18PM

11
#103 - PLS / @jaegd

08/16/2014 at 11:55PM

11
#104 - Bill Booth / @ohiopyle

08/27/2014 at 07:29AM

11
#105 - Johannes H. / @neVexa

09/23/2014 at 09:43AM

11
#106 - eBrnd / @eBrnd

11/02/2014 at 06:50PM

11
#107 - Vincent Dumoulin / @dumoulinv

11/23/2014 at 08:30PM

11
#108 - Jake Eskel / @JakeEskel

01/07/2015 at 02:49AM

11
#109 - kimber gonzalez / @kimberlycreates

01/13/2015 at 10:00PM

11
#110 - Johannes Elferich / @jojoelfe

04/25/2015 at 05:10AM

11
#111 - Raj / @brshenoy

05/14/2015 at 03:00PM

11
#112 - Mutter Mumble / @muttermumble

07/10/2015 at 09:36PM

11
#113 - Louis Burke / @LambdaABeta

07/24/2015 at 02:28PM

11
#114 - Dan Moldovan / @Lenea92

08/31/2015 at 11:02AM

11
#115 - Kirill Cherkashin / @kirjs

09/22/2015 at 02:33PM

11
#116 - Mike Adams / @davis_cromwell

10/04/2015 at 12:02AM

11
#117 - Walker Boh / @walker_boh

10/08/2015 at 10:35AM

11
#118 - Jon Krause / @jkrause314

10/18/2015 at 02:38AM

11
#119 - ハチポケッツ / @8pockets

11/20/2015 at 12:54AM

11
#120 - Paul S / @guesswrx

12/07/2015 at 08:53PM