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

627 active golfers, 1982 entries

Leaderboard (lowest score wins):
12
#301 - Mario Olofo / @mario_olofo

10/24/2019 at 09:08PM

12
#302 - Lory / @Lory46845742

11/14/2019 at 12:48PM

12
#303 - Raman Venugopal / @raman162

01/29/2020 at 01:12AM

12
#304 - Jose Elera / @jelera

01/29/2020 at 01:15AM

12
#305 - countime / @countime1

03/17/2020 at 06:19AM

12
#306 - Jason Neylon / @jasonneylon

03/21/2020 at 10:21AM

12
#307 - iBhagwan / @iiBhagwan

05/19/2020 at 06:42PM

12
#308 - Jason / @roosjason

06/05/2020 at 10:38AM

12
#309 - MySelf / @okmslf

10/18/2020 at 02:16PM

12
#310 - roudens / @roudens2

12/20/2020 at 04:02AM

12
#311 - Michel Viktor / @tomkpz

08/11/2021 at 01:29AM

12
#312 - Jean George / @JeanGeo20504212

10/09/2021 at 09:48PM

12
#313 - Flimsy Giraffe / @flimsy_giraffe

11/28/2021 at 05:57PM

12
#314 - blabla zincou / @BZincou

04/06/2022 at 08:58PM

12
#315 - Levi Wheeler / @LeviWhe68726437

06/15/2022 at 07:40PM

13
#316 - mnx / @mnxx

06/04/2012 at 04:02PM

13
#317 - Thierry Flauss / @ThFjunior

06/13/2012 at 07:25PM

13
#318 - Marcin Owerczuk / @marcinowerczuk

06/14/2012 at 07:54AM

13
#319 - Radek / @qrczeno

06/18/2012 at 07:58AM

13
#320 - J Paul Daigle / @philosodad

06/18/2012 at 08:58PM

13
#321 - Ilya Ermolin / @ermolinis

06/21/2012 at 07:40AM

13
#322 - Øystein Walle / @oysteinwalle

06/25/2012 at 08:37PM

13
#323 - Adit Cahya Ramadhan / @aditcr8

07/14/2012 at 10:18PM

13
#324 - Verity / @dv4me

07/15/2012 at 12:45AM

13
#325 - Drew Benedetti / @cnorsl

07/17/2012 at 07:21PM

13
#326 - William Dunand / @wdunand

07/27/2012 at 07:32AM

13
#327 - Jordan Eldredge / @captbaritone

07/29/2012 at 03:26PM

13
#328 - Peter Schlette / @pschlette

08/01/2012 at 01:10AM

13
#329 - Rahul Savani / @rahul_savani

08/11/2012 at 03:47PM

13
#330 - Catalin Ciurea / @catalinciurea

08/25/2012 at 08:32PM