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):
20
#571 - BartJanssen / @BartJanssen

03/12/2015 at 10:06PM

21
#572 - Philippe Creux / @pcreux

07/13/2012 at 06:44AM

21
#573 - Artur Chruszcz / @a_chru

09/15/2013 at 01:52PM

21
#574 - Alberto Pose / @thepose

11/06/2013 at 06:04PM

22
#575 - Gowtham Madhava / @gowthamgowtham

07/02/2012 at 04:54PM

23
#576 - Tyler Breisacher / @tbreisacher

08/25/2012 at 07:40AM

25
#577 - Howard / @h0w412d

07/16/2012 at 02:53AM

25
#578 - Korbinian Stoemmer / @PaulSmecker

03/08/2013 at 01:15PM

25
#579 - DeusExHominis / @DeusExHominis

02/18/2015 at 04:39AM

26
#580 - Julian / @JulianGindi

02/28/2016 at 06:39PM

26
#581 - Shunichi Kanade / @shunkana

12/02/2018 at 10:03AM

27
#582 - Noel Alejandro / @noelrock333

06/22/2012 at 11:03PM

27
#583 - Radu Bogdan Croitoru / @dotx

02/21/2014 at 11:19PM

28
#584 - Dustin Willis Webber / @Mephux

08/28/2012 at 04:29PM

31
#585 - JR Tashjian / @jrtashjian

04/18/2013 at 05:49PM

33
#586 - Jan Wedekind / @wedesoft

07/12/2012 at 09:43PM

47
#587 - DK / @scelerat

01/28/2014 at 07:51PM

48
#588 - Jurica / @Jurica34581259

11/16/2018 at 01:44PM

63
#589 - 🎱 Josh Branchaud 🔥 / @jbrancha

08/24/2016 at 01:02AM