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 665 remaining solutions by signing in and submitting your own entry
#666 openbrackett / @openbrackett - Score: 110 - 04/15/24 @ 13:45
wwwvwhdlll<BS>i<BS><BS><Esc>lllli<50-53>vimgolf put 4fcccb70024f950001000026<Esc>[201~<BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS><BS>, <Esc>p<Esc>:w<CR>:q<CR>

0 comments


Created by: @Ajnasz

666 active golfers, 2147 entries

Leaderboard (lowest score wins):
13
#421 - Florian Gauger / @FlorianGauger

06/05/2017 at 05:17PM

13
#422 - MS / @schrectacular

06/09/2017 at 04:39PM

13
#423 - Dominic Z / @thammaaa

02/01/2018 at 12:54PM

13
#424 - Paul Draghicescu / @pdragy

03/27/2018 at 02:53PM

13
#425 - Luke Lee / @luke0201

05/06/2018 at 09:10AM

13
#426 - aaa1195 / @aaa11954

08/07/2018 at 06:00PM

13
#427 - albalitz / @_albalitz

06/06/2019 at 01:07PM

13
#428 - hokonch / @hokonch

12/22/2019 at 04:59PM

13
#429 - Jake Worth / @jwworth

01/29/2020 at 01:09AM

13
#430 - 0xf00ff00f / @0xf00ff00f

10/19/2023 at 08:47PM

13
#431 - gpfl0712 / @gpfl0712

04/14/2024 at 12:46PM

14
#432 - Jacob Vosmaer / @jacobvosmaer

06/04/2012 at 07:53PM

14
#433 - Javier Blanco / @jbgutierrez

06/04/2012 at 10:53PM

14
#434 - captain_morgan / @captain_morgan

06/05/2012 at 09:17AM

14
#435 - Robin Landström / @R_Landstrom

06/06/2012 at 06:54PM

14
#436 - Dil / @dilpun

06/08/2012 at 12:44PM

14
#437 - Alex David / @alexd_me

06/13/2012 at 06:15PM

14
#438 - buz / @buzbone

06/15/2012 at 01:25AM

14
#439 - Nimlar / @Nimlar

06/15/2012 at 08:50AM

14
#440 - Carl Furrow / @carl_furrow

06/22/2012 at 06:12PM

14
#441 - Joe McCall / @joem86

07/02/2012 at 09:57PM

14
#442 - Marco / @xmarkoz

07/04/2012 at 06:13PM

14
#443 - Eric Mathison / @ericmathison

07/13/2012 at 07:38AM

14
#444 - Steve Burdick / @kairu0

07/22/2012 at 06:18AM

14
#445 - Caleb McDaniel / @wcaleb

07/25/2012 at 06:36PM

14
#446 - Dan Oneata / @DanOneata

08/04/2012 at 09:38AM

14
#447 - Jacob Taylor / @jacobltaylor

08/05/2012 at 02:41AM

14
#448 - Björn Holdt / @bholdt

08/10/2012 at 07:19PM

14
#449 - Michael Limiero / @michaellimiero

08/13/2012 at 11:54PM

14
#450 - Brian Chen / @betaveros

08/21/2012 at 08:43AM