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

595 active golfers, 1857 entries

Leaderboard (lowest score wins):
13
#301 - Jordan Eldredge / @captbaritone

07/29/2012 at 03:26PM

13
#302 - Peter Schlette / @pschlette

08/01/2012 at 01:10AM

13
#303 - Rahul Savani / @rahul_savani

08/11/2012 at 03:47PM

13
#304 - Catalin Ciurea / @catalinciurea

08/25/2012 at 08:32PM

13
#305 - tmr / @tmr314

09/05/2012 at 08:55AM

13
#306 - Joseph Barratt / @josephmbarratt

09/10/2012 at 10:26PM

13
#307 - Dylan Hudson / @dyln_hdsn

10/12/2012 at 08:20PM

13
#308 - Stanisław / @Wasiutynski

10/19/2012 at 08:18AM

13
#309 - Lunaritian / @Lunaritian

10/20/2012 at 09:21PM

13
#310 - Yavor Atov / @YavorAtOff

11/22/2012 at 09:08AM

13
#311 - Alex Hammel / @AlexJHammel

12/23/2012 at 02:46PM

13
#312 - Matthias Viehweger / @der_kronn

03/19/2013 at 11:57AM

13
#313 - Bogdan Gusiev / @bgusiev

07/01/2013 at 08:25PM

13
#314 - Steve Tjoa / @stevetjoa

07/04/2013 at 05:57AM

13
#315 - Andrew Noyes / @seyonwerdna

07/08/2013 at 07:19AM

13
#316 - curist / @curist

07/08/2013 at 10:38AM

13
#317 - Joel Taylor / @joelteon_

07/23/2013 at 02:16AM

13
#318 - scott_royston / @scott_royston

08/01/2013 at 05:47AM

13
#319 - Jeff Klein / @ravioli_jazz

08/02/2013 at 07:56AM

13
#320 - cj / @cj01101

08/04/2013 at 07:15PM

13
#321 - Dom Armstrong / @dom_cycleface

08/22/2013 at 12:44PM

13
#322 - Fontaine Kévin / @DotSlash974

08/24/2013 at 05:57PM

13
#323 - Tim Mower / @timmow

08/27/2013 at 07:32PM

13
#324 - Joey Twiddle / @joeytwiddle

09/01/2013 at 04:49PM

13
#325 - Elias Dorneles / @eliasdorneles

09/03/2013 at 01:44PM

13
#326 - Andrew Crites / @ExplosionPills

09/12/2013 at 02:22PM

13
#327 - brett / @brettyukich

09/19/2013 at 11:03AM

13
#328 - Sinclair Desaud / @sdesaud

09/26/2013 at 05:55AM

13
#329 - NuM / @NuM314

10/05/2013 at 09:42PM

13
#330 - evilmoe ☮ / @evilmoe

10/13/2013 at 10:05PM