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

595 active golfers, 1857 entries

Leaderboard (lowest score wins):
14
#451 - Petar Saulic / @gorillawarfare9

10/27/2017 at 12:20PM

14
#452 - Geoff / @RealGeoffErwin

12/18/2017 at 08:27PM

14
#453 - hails3 / @hails33

05/28/2018 at 04:23PM

14
#454 - Viktor Voronin / @voroninman

08/22/2018 at 09:36AM

14
#455 - Jeff / @sir_wiggles3

09/14/2018 at 12:23AM

14
#456 - Florent Jaby / @Floby

10/15/2018 at 12:34PM

14
#457 - Luis Rodriguez / @luisthecoder

11/15/2018 at 09:02PM

14
#458 - Phoon / @justflashhim

05/11/2019 at 02:54PM

14
#459 - José / @AngelGaldamez

09/02/2019 at 03:56AM

15
#460 - Aaron Lake / @aaronmlake

06/04/2012 at 03:06PM

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

06/04/2012 at 03:14PM

15
#462 - John Whitley / @johnwhitley

06/04/2012 at 03:44PM

15
#463 - Benjamin Sergeant / @bsergean

06/05/2012 at 04:47AM

15
#464 - Dave / @zzdave13

06/10/2012 at 03:28PM

15
#465 - abonec / @abonec

06/11/2012 at 11:26AM

15
#466 - Josh Steiner / @josh_steiner

06/12/2012 at 01:19AM

15
#467 - Carlos Hernando / @chernando

06/13/2012 at 06:53PM

15
#468 - ise0615 / @ise0615

06/15/2012 at 05:38AM

15
#469 - Pandae / @psasqw

06/21/2012 at 06:44PM

15
#470 - Brandon Montgomery / @bmonty

06/23/2012 at 01:31PM

15
#471 - Toto l'haricot / @nico_le_terribl

07/05/2012 at 06:22PM

15
#472 - Michael Blatherwick / @rogue_michael

07/06/2012 at 08:54AM

15
#473 - Robby Grossman / @freerobby

07/17/2012 at 03:51AM

15
#474 - Federico Bond / @federicobond

07/18/2012 at 05:49AM

15
#475 - Allan Caffee / @AllanCaffee

08/08/2012 at 07:12AM

15
#476 -  Ikhsan Maulana / @ixandidu

08/18/2012 at 02:47PM

15
#477 - juan patlang / @juanpatlang

08/23/2012 at 08:57AM

15
#478 - Ori Kremer / @orikr

08/28/2012 at 08:35PM

15
#479 - Arto Vuori / @dhpe

08/31/2012 at 07:25PM

15
#480 - Nicolas Friedli / @NicolasFriedli

10/29/2012 at 04:50PM