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):
12
#181 - Matt Walker / @_walkermatt

06/18/2012 at 04:39PM

12
#182 - Vitaly Kushner / @vkushner

06/21/2012 at 12:58AM

12
#183 - Vasil Sakarov / @vsakarov

06/26/2012 at 10:16AM

12
#184 - Lukas Korsika / @LKorsika

07/17/2012 at 05:19AM

12
#185 - Nipunn Koorapati / @nipunn1313

07/18/2012 at 05:58AM

12
#186 - Glen / @Glen_S

07/21/2012 at 08:25PM

12
#187 - James Davis / @tripvg

08/04/2012 at 04:55PM

12
#188 - Слава / @slava_and_ipad

08/08/2012 at 01:50PM

12
#189 - Matty Williams / @matty_jwilliams

08/18/2012 at 12:55PM

12
#190 - Jomo / @yoyoyojomo

08/18/2012 at 01:13PM

12
#191 - Martin Petrov / @mgpetrov

08/22/2012 at 03:10AM

12
#192 - Jearaen Yalalay / @Jearaen

08/22/2012 at 08:57AM

12
#193 - Dmitry Olyenyov / @Dmitry_Olyenyov

08/22/2012 at 10:05AM

12
#194 - Brendan Op 't Root / @OptrootB

08/29/2012 at 11:12AM

12
#195 - Maksim S. / @waynesayonara

09/03/2012 at 09:00PM

12
#196 - Javier Cervantes / @solojavier

09/05/2012 at 06:36PM

12
#197 - BostX / @BostX

09/06/2012 at 04:59PM

12
#198 - Joachim / @jodles89

09/12/2012 at 12:04AM

12
#199 - Domon / @Domon

09/12/2012 at 02:21AM

12
#200 - Édouard M'tou / @DouardM

10/09/2012 at 04:39PM

12
#201 - Dan Goldstein / @dggoldst

10/15/2012 at 06:38PM

12
#202 - Marcin Sza / @coot_

11/23/2012 at 09:53AM

12
#203 - Panupan S. / @lionpeal

01/11/2013 at 07:05PM

12
#204 - Kai Yuan / @kentyuan

02/21/2013 at 04:28PM

12
#205 - Sheila Sha / @5h31la5ha

02/23/2013 at 12:17PM

12
#206 - Justin / @justinjaffray

04/23/2013 at 08:03PM

12
#207 - Bradd Szonye / @bszonye

07/11/2013 at 07:54AM

12
#208 - Christopher Bahr / @bahrware

07/11/2013 at 07:12PM

12
#209 - Woojung Kim 김우중 / @_kimwz

07/12/2013 at 04:25AM

12
#210 - Nathan / @NathanHarperoni

08/04/2013 at 05:47PM