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

591 active golfers, 1850 entries

Leaderboard (lowest score wins):
13
#331 - lastsseldon / @lastsseldon

11/04/2013 at 02:51AM

13
#332 - albert peng / @holoiii

11/07/2013 at 01:33AM

13
#333 - - / @swi93

12/06/2013 at 07:59AM

13
#334 - Juho Jokelainen / @juhojokelainen

12/09/2013 at 10:23PM

13
#335 - Petr Broz / @ipetrbroz

12/17/2013 at 02:01AM

13
#336 - winterlight / @winterlight4

12/28/2013 at 08:00PM

13
#337 - Quota / @Quotad

01/14/2014 at 09:20AM

13
#338 - Павел Игоревич / @VizierST

02/03/2014 at 08:45PM

13
#339 - barnabaguy / @barnabaguy

02/20/2014 at 10:54PM

13
#340 - Brian Olpin / @bolpin

03/28/2014 at 06:35AM

13
#341 - Endir / @Endir2

04/17/2014 at 11:03PM

13
#342 - Solar Powered Robot / @moskrin

04/30/2014 at 06:32PM

13
#343 - Tim Habermaas / @timhabermaas

06/24/2014 at 08:44PM

13
#344 - Justin Beaudry / @JustinNBeaudry

07/08/2014 at 09:32PM

13
#345 - yohei / @ebahy

09/20/2014 at 06:36AM

13
#346 - deris / @deris0126

11/06/2014 at 11:11PM

13
#347 - Josu Oyanguren / @josuoyanguren

12/19/2014 at 10:33AM

13
#348 - Matt / @mcr05

01/07/2015 at 04:03PM

13
#349 - TheProgrammer971 / @tp971

03/14/2015 at 02:52AM

13
#350 - vgmct / @vgmct

04/25/2015 at 10:52PM

13
#351 - Maxime / @Maxime_VII

06/24/2015 at 02:41PM

13
#352 - Kiet Nguyen / @kietnguyen86

09/29/2015 at 02:46PM

13
#353 - Gerald Tilma / @GeraldTilma

10/19/2015 at 04:21AM

13
#354 - ORchard test / @BilboBrovall

10/26/2015 at 01:55PM

13
#355 - Árpád Krejczinger / @krarpi

11/09/2015 at 05:01PM

13
#356 - Bruno Vieira Costa / @bruno_vcosta

11/28/2015 at 09:21PM

13
#357 - I / @ForgetIt17

11/29/2015 at 04:46PM

13
#358 - fuck GFW / @ravishGFW

01/05/2016 at 05:14AM

13
#359 - TerribleTrioJoe / @terribletriojoe

02/09/2016 at 09:17PM

13
#360 - Janine Cheng / @janineist

02/12/2016 at 05:56PM