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

572 active golfers, 1785 entries

Leaderboard (lowest score wins):
11
#1 - Urtica dioica / @udioica

06/04/2012 at 06:49PM

11
#2 - Conner McDaniel / @connermcd

06/04/2012 at 09:07PM

11
#3 - Tim Chase / @gumnos

06/05/2012 at 01:51AM

11
#4 - Justin Love / @wondible

06/05/2012 at 02:53AM

11
#5 - Benoit Mortgat / @Benoit_Mortgat

06/05/2012 at 05:21AM

11
#6 - Paul Gessler / @pdgessler

06/07/2012 at 01:43AM

11
#7 - shutl_test / @shutl_test

06/07/2012 at 12:34PM

11
#8 - utopiah / @utopiah

06/08/2012 at 01:10PM

11
#9 - Drew Hannay / @drewhannay

06/09/2012 at 06:55AM

11
#10 - Tibor Claassen / @codebeige

06/09/2012 at 01:28PM

11
#11 - Joakim L. Engeset / @joakim_eng

06/11/2012 at 05:17PM

11
#12 - David / @ebonhand09

06/12/2012 at 02:20PM

11
#13 - Baylor Rae' / @BaylorRae

06/12/2012 at 09:19PM

11
#14 - RusAlex Pletnev / @RusAlexander

06/13/2012 at 06:44PM

11
#15 - Jacek Wysocki / @ex00

06/14/2012 at 08:48AM

11
#16 - Rolf Bjaanes / @rolfb

06/15/2012 at 01:59PM

11
#17 - noom narze / @NarzE

06/18/2012 at 05:32AM

11
#18 - Federico Galassi / @federicogalassi

06/18/2012 at 10:59PM

11
#19 - abernardes / @abernardes

06/21/2012 at 03:55PM

11
#20 - Ryan O'Connell / @Salshammath

06/21/2012 at 04:52PM

11
#21 - Miha Filej / @mfilej

06/21/2012 at 05:23PM

11
#22 - mwatkward / @AftrschoolSpe

06/22/2012 at 12:36PM

11
#23 - Alexander Washman / @sanchous

07/07/2012 at 08:09AM

11
#24 - Wei Dai / @clvv42

07/12/2012 at 08:33PM

11
#25 - Michael Eisel / @michaeleisel

07/14/2012 at 02:44AM

11
#26 - wes / @_weslly

07/19/2012 at 01:48AM

11
#27 - h_east (トロッコ6個) / @h_east

07/19/2012 at 10:12AM

11
#28 - Paul Tarjan / @ptarjan

07/29/2012 at 05:30PM

11
#29 - Ryan Patterson / @CGamesPlay

07/29/2012 at 05:34PM

11
#30 - John Goalby / @johngoalby

07/30/2012 at 09:38PM