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):
14
#451 - Jeff / @sir_wiggles3

09/14/2018 at 12:23AM

14
#452 - Florent Jaby / @Floby

10/15/2018 at 12:34PM

14
#453 - Luis Rodriguez / @luisthecoder

11/15/2018 at 09:02PM

14
#454 - Phoon / @justflashhim

05/11/2019 at 02:54PM

14
#455 - José / @AngelGaldamez

09/02/2019 at 03:56AM

15
#456 - Aaron Lake / @aaronmlake

06/04/2012 at 03:06PM

15
#457 - Raphaël De Giusti / @raphdg

06/04/2012 at 03:14PM

15
#458 - John Whitley / @johnwhitley

06/04/2012 at 03:44PM

15
#459 - Benjamin Sergeant / @bsergean

06/05/2012 at 04:47AM

15
#460 - Dave / @zzdave13

06/10/2012 at 03:28PM

15
#461 - abonec / @abonec

06/11/2012 at 11:26AM

15
#462 - Josh Steiner / @josh_steiner

06/12/2012 at 01:19AM

15
#463 - Carlos Hernando / @chernando

06/13/2012 at 06:53PM

15
#464 - ise0615 / @ise0615

06/15/2012 at 05:38AM

15
#465 - Pandae / @psasqw

06/21/2012 at 06:44PM

15
#466 - Brandon Montgomery / @bmonty

06/23/2012 at 01:31PM

15
#467 - Toto l'haricot / @nico_le_terribl

07/05/2012 at 06:22PM

15
#468 - Michael Blatherwick / @rogue_michael

07/06/2012 at 08:54AM

15
#469 - Robby Grossman / @freerobby

07/17/2012 at 03:51AM

15
#470 - Federico Bond / @federicobond

07/18/2012 at 05:49AM

15
#471 - Allan Caffee / @AllanCaffee

08/08/2012 at 07:12AM

15
#472 -  Ikhsan Maulana / @ixandidu

08/18/2012 at 02:47PM

15
#473 - juan patlang / @juanpatlang

08/23/2012 at 08:57AM

15
#474 - Ori Kremer / @orikr

08/28/2012 at 08:35PM

15
#475 - Arto Vuori / @dhpe

08/31/2012 at 07:25PM

15
#476 - Nicolas Friedli / @NicolasFriedli

10/29/2012 at 04:50PM

15
#477 - Underhill Labs / @underhilllabs

10/30/2012 at 04:38AM

15
#478 - Adam Dratwinski / @adwinsky

11/27/2012 at 07:46PM

15
#479 - Casey Robinson / @rampant_monkey

12/05/2012 at 09:32PM

15
#480 - Timothée Gauthier / @zmf_tim

07/13/2013 at 06:31AM