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

606 active golfers, 1888 entries

Leaderboard (lowest score wins):
13
#331 - Joey Twiddle / @joeytwiddle

09/01/2013 at 04:49PM

13
#332 - Elias Dorneles / @eliasdorneles

09/03/2013 at 01:44PM

13
#333 - Andrew Crites / @ExplosionPills

09/12/2013 at 02:22PM

13
#334 - brett / @brettyukich

09/19/2013 at 11:03AM

13
#335 - Sinclair Desaud / @sdesaud

09/26/2013 at 05:55AM

13
#336 - NuM / @NuM314

10/05/2013 at 09:42PM

13
#337 - evilmoe ☮ / @evilmoe

10/13/2013 at 10:05PM

13
#338 - A. N. / @arez42

10/24/2013 at 06:40AM

13
#339 - Fnord Everywhere / @FnordE

10/31/2013 at 08:35AM

13
#340 - lastsseldon / @lastsseldon

11/04/2013 at 02:51AM

13
#341 - albert peng / @holoiii

11/07/2013 at 01:33AM

13
#342 - - / @swi93

12/06/2013 at 07:59AM

13
#343 - Juho Jokelainen / @juhojokelainen

12/09/2013 at 10:23PM

13
#344 - Petr Broz / @ipetrbroz

12/17/2013 at 02:01AM

13
#345 - winterlight / @winterlight4

12/28/2013 at 08:00PM

13
#346 - Quota / @Quotad

01/14/2014 at 09:20AM

13
#347 - Павел Игоревич / @VizierST

02/03/2014 at 08:45PM

13
#348 - barnabaguy / @barnabaguy

02/20/2014 at 10:54PM

13
#349 - Brian Olpin / @bolpin

03/28/2014 at 06:35AM

13
#350 - Endir / @Endir2

04/17/2014 at 11:03PM

13
#351 - Solar Powered Robot / @moskrin

04/30/2014 at 06:32PM

13
#352 - Tim Habermaas / @timhabermaas

06/24/2014 at 08:44PM

13
#353 - Justin Beaudry / @JustinNBeaudry

07/08/2014 at 09:32PM

13
#354 - yohei / @ebahy

09/20/2014 at 06:36AM

13
#355 - deris / @deris0126

11/06/2014 at 11:11PM

13
#356 - Josu Oyanguren / @josuoyanguren

12/19/2014 at 10:33AM

13
#357 - Matt / @mcr05

01/07/2015 at 04:03PM

13
#358 - TheProgrammer971 / @tp971

03/14/2015 at 02:52AM

13
#359 - vgmct / @vgmct

04/25/2015 at 10:52PM

13
#360 - Maxime / @Maxime_VII

06/24/2015 at 02:41PM