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):
13
#301 - tmr / @tmr314

09/05/2012 at 08:55AM

13
#302 - Joseph Barratt / @josephmbarratt

09/10/2012 at 10:26PM

13
#303 - Dylan Hudson / @dyln_hdsn

10/12/2012 at 08:20PM

13
#304 - Stanisław / @Wasiutynski

10/19/2012 at 08:18AM

13
#305 - Lunaritian / @Lunaritian

10/20/2012 at 09:21PM

13
#306 - Yavor Atov / @YavorAtOff

11/22/2012 at 09:08AM

13
#307 - Alex Hammel / @AlexJHammel

12/23/2012 at 02:46PM

13
#308 - Matthias Viehweger / @der_kronn

03/19/2013 at 11:57AM

13
#309 - Bogdan Gusiev / @bgusiev

07/01/2013 at 08:25PM

13
#310 - Steve Tjoa / @stevetjoa

07/04/2013 at 05:57AM

13
#311 - Andrew Noyes / @seyonwerdna

07/08/2013 at 07:19AM

13
#312 - curist / @curist

07/08/2013 at 10:38AM

13
#313 - Joel Taylor / @joelteon_

07/23/2013 at 02:16AM

13
#314 - scott_royston / @scott_royston

08/01/2013 at 05:47AM

13
#315 - Jeff Klein / @ravioli_jazz

08/02/2013 at 07:56AM

13
#316 - cj / @cj01101

08/04/2013 at 07:15PM

13
#317 - Dom Armstrong / @dom_cycleface

08/22/2013 at 12:44PM

13
#318 - Fontaine Kévin / @DotSlash974

08/24/2013 at 05:57PM

13
#319 - Tim Mower / @timmow

08/27/2013 at 07:32PM

13
#320 - Joey Twiddle / @joeytwiddle

09/01/2013 at 04:49PM

13
#321 - Elias Dorneles / @eliasdorneles

09/03/2013 at 01:44PM

13
#322 - Andrew Crites / @ExplosionPills

09/12/2013 at 02:22PM

13
#323 - brett / @brettyukich

09/19/2013 at 11:03AM

13
#324 - Sinclair Desaud / @sdesaud

09/26/2013 at 05:55AM

13
#325 - NuM / @NuM314

10/05/2013 at 09:42PM

13
#326 - evilmoe ☮ / @evilmoe

10/13/2013 at 10:05PM

13
#327 - A. N. / @arez42

10/24/2013 at 06:40AM

13
#328 - Fnord Everywhere / @FnordE

10/31/2013 at 08:35AM

13
#329 - lastsseldon / @lastsseldon

11/04/2013 at 02:51AM

13
#330 - albert peng / @holoiii

11/07/2013 at 01:33AM