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):
19
#571 - Святослав Сюрин / @rmrfhome

06/11/2012 at 01:16PM

19
#572 - Zach Kemp / @zvksf

12/18/2013 at 04:47PM

19
#573 - stb tra / @stbtra

01/29/2014 at 05:16AM

19
#574 - Feras / @faldah

05/02/2016 at 02:07AM

19
#575 - Gurukandhamoorthi / @Gurukandhamoor1

07/11/2017 at 02:03PM

20
#576 - BartJanssen / @BartJanssen

03/12/2015 at 10:06PM

21
#577 - Philippe Creux / @pcreux

07/13/2012 at 06:44AM

21
#578 - Artur Chruszcz / @a_chru

09/15/2013 at 01:52PM

21
#579 - Alberto Pose / @thepose

11/06/2013 at 06:04PM

22
#580 - Gowtham Madhava / @gowthamgowtham

07/02/2012 at 04:54PM

23
#581 - Tyler Breisacher / @tbreisacher

08/25/2012 at 07:40AM

25
#582 - Howard / @h0w412d

07/16/2012 at 02:53AM

25
#583 - Korbinian Stoemmer / @PaulSmecker

03/08/2013 at 01:15PM

25
#584 - DeusExHominis / @DeusExHominis

02/18/2015 at 04:39AM

26
#585 - Julian / @JulianGindi

02/28/2016 at 06:39PM

26
#586 - Shunichi Kanade / @shunkana

12/02/2018 at 10:03AM

27
#587 - Noel Alejandro / @noelrock333

06/22/2012 at 11:03PM

27
#588 - Radu Bogdan Croitoru / @dotx

02/21/2014 at 11:19PM

28
#589 - Dustin Willis Webber / @Mephux

08/28/2012 at 04:29PM

28
#590 - Aaron / @_Lordofthevoid_

12/03/2019 at 05:12PM

31
#591 - JR Tashjian / @jrtashjian

04/18/2013 at 05:49PM

33
#592 - Jan Wedekind / @wedesoft

07/12/2012 at 09:43PM

47
#593 - DK / @scelerat

01/28/2014 at 07:51PM

48
#594 - Jurica / @Jurica34581259

11/16/2018 at 01:44PM

63
#595 - 🎱 Josh Branchaud 🔥 / @jbrancha

08/24/2016 at 01:02AM