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
#271 - Brian Hall / @_bruab_

07/20/2017 at 03:06PM

12
#272 - xyz / @menhej

02/03/2018 at 12:30PM

12
#273 - 石奕心 / @allenshih1

06/07/2018 at 03:43AM

12
#274 - Ryan Connolly / @ryanconnnolly

06/23/2018 at 09:56AM

12
#275 - Apox / @apox159

07/20/2018 at 08:01PM

12
#276 - qed / @qed13308565

07/25/2018 at 04:47PM

12
#277 - Guirec CORBEL / @GuirecCorbel

09/09/2018 at 07:24PM

12
#278 - chaotic / @laersn

09/11/2018 at 11:24AM

12
#279 - Robin De Mol / @RobinDeMol

09/14/2018 at 09:28AM

12
#280 - Kasparas Lavrukaitis / @kaslvr

11/09/2018 at 03:54PM

12
#281 - Homer Simp12586 / @simp12586

11/18/2018 at 06:58PM

12
#282 - Mihai / @mihaicristiant

12/08/2018 at 01:04PM

12
#283 - Bruno Cunha / @bruncun

12/19/2018 at 12:59AM

12
#284 - Mateen Ulhaq / @sicariusnoctis

02/15/2019 at 04:25AM

12
#285 - Chester Yap / @Chest_ErYap

07/29/2019 at 12:23AM

13
#286 - mnx / @mnxx

06/04/2012 at 04:02PM

13
#287 - Thierry Flauss / @ThFjunior

06/13/2012 at 07:25PM

13
#288 - Marcin Owerczuk / @marcinowerczuk

06/14/2012 at 07:54AM

13
#289 - Radek / @qrczeno

06/18/2012 at 07:58AM

13
#290 - J Paul Daigle / @philosodad

06/18/2012 at 08:58PM

13
#291 - Ilya Ermolin / @ermolinis

06/21/2012 at 07:40AM

13
#292 - Øystein Walle / @oysteinwalle

06/25/2012 at 08:37PM

13
#293 - Adit Cahya Ramadhan / @aditcr8

07/14/2012 at 10:18PM

13
#294 - Verity / @dv4me

07/15/2012 at 12:45AM

13
#295 - Drew Benedetti / @cnorsl

07/17/2012 at 07:21PM

13
#296 - William Dunand / @wdunand

07/27/2012 at 07:32AM

13
#297 - Jordan Eldredge / @captbaritone

07/29/2012 at 03:26PM

13
#298 - Peter Schlette / @pschlette

08/01/2012 at 01:10AM

13
#299 - Rahul Savani / @rahul_savani

08/11/2012 at 03:47PM

13
#300 - Catalin Ciurea / @catalinciurea

08/25/2012 at 08:32PM