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

592 active golfers, 1852 entries

Leaderboard (lowest score wins):
16
#541 - skensell / @skensell

04/27/2014 at 08:48AM

16
#542 - Subhi Dweik / @SubhiDweik

06/02/2014 at 11:40PM

16
#543 - r. / @rmarvie

12/19/2014 at 09:41PM

16
#544 - ɐʇnɥsɐpoʇ / @todashuta

03/25/2015 at 01:55PM

16
#545 - ɹǝsnɐɥsıʇnɹ uoɾ / @JonRutis

06/16/2015 at 07:11PM

16
#546 - Tran Duc Thang / @thangtd90

03/06/2016 at 08:36AM

16
#547 - Ryan van Rensburg / @rdvr001

07/23/2016 at 09:29AM

16
#548 - carbonscott / @wangimagine

08/23/2016 at 04:16AM

16
#549 - Jon E. Eguiluz / @viroide

02/24/2017 at 11:27AM

16
#550 - dorpo / @dorpo2

11/01/2018 at 10:30PM

16
#551 - Mike C / @StrixVariaXIX

04/22/2019 at 04:29PM

16
#552 - Chris G / @AboutThatThing

06/11/2019 at 07:28AM

17
#553 - James Cash / @jamesnvc

06/04/2012 at 06:29PM

17
#554 - Endri Runa / @endiruna

06/10/2012 at 03:15PM

17
#555 - emmanuel delgado / @chischaschos

06/22/2012 at 05:11PM

17
#556 - Dave Aitken / @actionshrimp

08/27/2013 at 06:43PM

17
#557 - wilddog64 / @chengkai318

12/17/2013 at 06:56PM

17
#558 - nope / @nope_gknobup

03/01/2015 at 11:28PM

17
#559 - Jonas Ng / @jnshey

05/15/2015 at 04:08PM

17
#560 - Henrik Lindgren / @HeLi8one

05/17/2015 at 07:49PM

17
#561 - William I. Olojede / @williamolojede

05/27/2018 at 05:05PM

17
#562 - 赤佐田奈葉 / @akasatanaha_

06/19/2018 at 04:51AM

18
#563 - Christopher Biscardi / @chrisbiscardi

07/17/2012 at 07:21AM

18
#564 - pikaren / @REALpikaren

12/22/2013 at 09:28AM

18
#565 - David M / @ohhhmandyyy

01/15/2014 at 11:24PM

18
#566 - Hannes Tydén / @pht

08/08/2014 at 11:32PM

18
#567 - Mike Herrera / @crftr

01/31/2016 at 10:43PM

19
#568 - Lajos Koszti / @Ajnasz

06/04/2012 at 02:52PM

19
#569 - Святослав Сюрин / @rmrfhome

06/11/2012 at 01:16PM

19
#570 - Zach Kemp / @zvksf

12/18/2013 at 04:47PM