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):
15
#511 - John Clara / @johnanthclara

02/11/2016 at 12:08AM

15
#512 - Andrew Krawchyk / @krawchyk

02/28/2016 at 06:38PM

15
#513 - Jake Worth / @jwworth

08/24/2016 at 01:07AM

15
#514 - Mike Land / @mikepland

08/24/2016 at 11:08PM

15
#515 - jack / @jack28887741

02/23/2017 at 10:58AM

15
#516 - Thomas Noe / @teh2mas

09/29/2017 at 05:32PM

15
#517 - prince ducaca / @prince_du_caca

09/26/2018 at 11:01PM

15
#518 - Brian Donovan / @eventualbuddha

11/29/2018 at 02:12AM

15
#519 - diwa / @Di_nate_

12/14/2018 at 07:46AM

15
#520 - Vladimir Leskov / @vladimirlesk

11/24/2019 at 11:27PM

16
#521 - Asenar / @asenar

06/08/2012 at 09:10AM

16
#522 - Omar Ramos / @_omarramos

06/09/2012 at 04:23AM

16
#523 - Mario Forner / @m_forner

06/18/2012 at 06:49PM

16
#524 - Dan Masquelier / @danmasq

06/19/2012 at 09:58PM

16
#525 - Anouar ADLANI / @aadlani

07/13/2012 at 11:05PM

16
#526 - Sebastian Korten / @FlashKorten

07/14/2012 at 10:28AM

16
#527 - Eric Söderström / @eksoderstrom

07/18/2012 at 05:55PM

16
#528 - fyolnish / @fyolnish

07/26/2012 at 01:17AM

16
#529 - Petri Rosenström / @wuzuuz

08/12/2012 at 09:48AM

16
#530 - Jason Bruce / @jbrucenet

08/26/2012 at 05:48PM

16
#531 - Dragos Miron / @capze

11/27/2012 at 08:07PM

16
#532 - James S.P. Barth / @sp_barth

01/16/2013 at 09:29PM

16
#533 - Niels Madan / @nielsmadan

01/22/2013 at 09:13PM

16
#534 - Sam Phippen / @samphippen

05/08/2013 at 08:47PM

16
#535 - Alexey / @kramar42

07/04/2013 at 12:50PM

16
#536 - Aaron Bieber / @aaronbieber

07/15/2013 at 09:52PM

16
#537 - Dr. Rev. J. "Paranoid Android" Kirchartz / @JKirchartz

07/25/2013 at 03:05AM

16
#538 - Sami Niiranen / @saminiir

10/13/2013 at 10:57AM

16
#539 - Toam / @Toam

12/20/2013 at 11:47PM

16
#540 - Aaron Burrow / @WillFapForFood

01/18/2014 at 12:54PM