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):
11
#61 - Rick Button / @rickbutton

07/24/2013 at 06:17AM

11
#62 - Ingo / @ist3fani

07/28/2013 at 03:23PM

11
#63 - David Pathakjee / @DavidPathakjee

08/15/2013 at 04:16AM

11
#64 - Chris Webb / @chriswebb_42

08/22/2013 at 10:56PM

11
#65 - John Papanastasiou / @JohnPapps

08/27/2013 at 06:54PM

11
#66 - Sam Rose / @samwhoo

08/27/2013 at 06:56PM

11
#67 - Oliver Caldwell / @OliverCaldwell

08/27/2013 at 07:14PM

11
#68 - Tim / @timwr

08/27/2013 at 07:17PM

11
#69 - Florian Rathgeber / @frathgeber

08/27/2013 at 07:27PM

11
#70 - Dan / @dan_winkler

08/30/2013 at 06:24PM

11
#71 - codegourmet / @codegourmet

10/01/2013 at 12:41PM

11
#72 - aRkadeFR / @aRkadeFR

10/04/2013 at 10:59PM

11
#73 - Jesse Nazario / @jessenzr

10/16/2013 at 07:41PM

11
#74 - François Marais / @maraisf

10/23/2013 at 02:34PM

11
#75 - Jack Z / @itszhou

10/29/2013 at 06:29AM

11
#76 - Nathan Wallace / @nathanmwallace

11/05/2013 at 08:16PM

11
#77 - Jonathan Potter / @nTypeRed

11/11/2013 at 09:46PM

11
#78 - John Braxler / @braxler

11/26/2013 at 11:47PM

11
#79 - Tony Vitonis / @vitonis

11/30/2013 at 03:38AM

11
#80 - Stefan Schmidt / @stafue

12/06/2013 at 10:10AM

11
#81 - Joshua Appelman / @JoshuaAppelman

12/21/2013 at 08:46PM

11
#82 - Rado Kirov / @radokirov

12/29/2013 at 07:39AM

11
#83 - Herrington Darkholme / @nonamesheep

12/31/2013 at 08:19AM

11
#84 - Ali El Amine / @Allouch95

02/02/2014 at 06:11PM

11
#85 - Franco Biasin / @francoKazan

02/12/2014 at 10:14PM

11
#86 - Andrew O'Neill / @AndroidOatmeal

02/17/2014 at 07:24PM

11
#87 - Mina Naguib / @minaguib

02/24/2014 at 04:02AM

11
#88 - Lucius L. Hilley III / @unkmar

02/27/2014 at 04:29AM

11
#89 - Hannes Remahl / @hannesr

02/28/2014 at 11:39AM

11
#90 - Jae Won Kim / @jaewone

03/05/2014 at 12:29PM