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):
14
#511 - Jeff / @sir_wiggles3

09/14/2018 at 12:23AM

14
#512 - Florent Jaby / @Floby

10/15/2018 at 12:34PM

14
#513 - Luis Rodriguez / @luisthecoder

11/15/2018 at 09:02PM

14
#514 - Phoon / @justflashhim

05/11/2019 at 02:54PM

14
#515 - Aioriya / @AioriyaDonk

09/02/2019 at 03:56AM

14
#516 - Ainsley McGrath / @whole_grainsley

01/29/2020 at 12:49AM

14
#517 - POSIX / @po6ix

01/24/2022 at 02:48PM

14
#518 - math is what I hate / @mpnmbn

03/13/2022 at 03:02PM

14
#519 - Rob / @robjbishop

09/14/2023 at 06:19AM

15
#520 - Aaron Lake / @aaronmlake

06/04/2012 at 03:06PM

15
#521 - Raphaël De Giusti / @raphdg

06/04/2012 at 03:14PM

15
#522 - John Whitley / @johnwhitley

06/04/2012 at 03:44PM

15
#523 - Benjamin Sergeant / @bsergean

06/05/2012 at 04:47AM

15
#524 - Dave / @zzdave13

06/10/2012 at 03:28PM

15
#525 - abonec / @abonec

06/11/2012 at 11:26AM

15
#526 - Josh Steiner / @josh_steiner

06/12/2012 at 01:19AM

15
#527 - Carlos Hernando / @chernando

06/13/2012 at 06:53PM

15
#528 - ise0615 / @ise0615

06/15/2012 at 05:38AM

15
#529 - Pandae / @psasqw

06/21/2012 at 06:44PM

15
#530 - Brandon Montgomery / @bmonty

06/23/2012 at 01:31PM

15
#531 - Toto l'haricot / @nico_le_terribl

07/05/2012 at 06:22PM

15
#532 - Michael Blatherwick / @rogue_michael

07/06/2012 at 08:54AM

15
#533 - Robby Grossman / @freerobby

07/17/2012 at 03:51AM

15
#534 - Federico Bond / @federicobond

07/18/2012 at 05:49AM

15
#535 - Allan Caffee / @AllanCaffee

08/08/2012 at 07:12AM

15
#536 -  Ikhsan Maulana / @ixandidu

08/18/2012 at 02:47PM

15
#537 - juan patlang / @juanpatlang

08/23/2012 at 08:57AM

15
#538 - Ori Kremer / @orikr

08/28/2012 at 08:35PM

15
#539 - Arto Vuori / @dhpe

08/31/2012 at 07:25PM

15
#540 - Nicolas Friedli / @NicolasFriedli

10/29/2012 at 04:50PM