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

606 active golfers, 1888 entries

Leaderboard (lowest score wins):
12
#271 - Solomon / @Trugbildjaeger

03/31/2017 at 06:03AM

12
#272 - Carl Egbert / @CarlOEgbert

06/13/2017 at 12:56AM

12
#273 - Ben Hill / @KaizenSoze70

06/30/2017 at 09:19PM

12
#274 - Brian Hall / @_bruab_

07/20/2017 at 03:06PM

12
#275 - xyz / @menhej

02/03/2018 at 12:30PM

12
#276 - 石奕心 / @allenshih1

06/07/2018 at 03:43AM

12
#277 - Ryan Connolly / @ryanconnnolly

06/23/2018 at 09:56AM

12
#278 - Apox / @apox159

07/20/2018 at 08:01PM

12
#279 - qed / @qed13308565

07/25/2018 at 04:47PM

12
#280 - Guirec CORBEL / @GuirecCorbel

09/09/2018 at 07:24PM

12
#281 - chaotic / @laersn

09/11/2018 at 11:24AM

12
#282 - Robin De Mol / @RobinDeMol

09/14/2018 at 09:28AM

12
#283 - Kasparas Lavrukaitis / @kaslvr

11/09/2018 at 03:54PM

12
#284 - Homer Simp12586 / @simp12586

11/18/2018 at 06:58PM

12
#285 - Mihai / @mihaicristiant

12/08/2018 at 01:04PM

12
#286 - Bruno Cunha / @bruncun

12/19/2018 at 12:59AM

12
#287 - Mateen Ulhaq / @sicariusnoctis

02/15/2019 at 04:25AM

12
#288 - Chester Yap / @Chest_ErYap

07/29/2019 at 12:23AM

12
#289 - Mario Olofo / @mario_olofo

10/24/2019 at 09:08PM

12
#290 - Lory / @Lory46845742

11/14/2019 at 12:48PM

12
#291 - Raman Venugopal / @raman162

01/29/2020 at 01:12AM

12
#292 - Jose Elera / @jelera

01/29/2020 at 01:15AM

12
#293 - countime / @countime1

03/17/2020 at 06:19AM

12
#294 - Jason Neylon / @jasonneylon

03/21/2020 at 10:21AM

12
#295 - Bhagwan / @El_Bhagwan

05/19/2020 at 06:42PM

12
#296 - Jason / @roosjason

06/05/2020 at 10:38AM

13
#297 - mnx / @mnxx

06/04/2012 at 04:02PM

13
#298 - Thierry Flauss / @ThFjunior

06/13/2012 at 07:25PM

13
#299 - Marcin Owerczuk / @marcinowerczuk

06/14/2012 at 07:54AM

13
#300 - Radek / @qrczeno

06/18/2012 at 07:58AM