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
#481 - Patrick Pitoscia / @Patrick03960431

08/04/2014 at 11:38PM

14
#482 - Greg / @developergreg

09/08/2014 at 02:32AM

14
#483 - Justin Knag / @justinknag

09/13/2014 at 03:40PM

14
#484 - Malte R / @maltoe

11/07/2014 at 06:51PM

14
#485 - Aaron Whittington / @whittaaron

01/16/2015 at 03:29AM

14
#486 - ಸುಬ್ರಹ್ಮಣ್ಯ ಜೋಶಿ / @subbucoding

04/03/2015 at 08:42PM

14
#487 - William Ott / @oddalot

04/14/2015 at 08:33PM

14
#488 - Hendrik Lammers / @hendriklammers

05/09/2015 at 10:02AM

14
#489 - luffy / @raxcoi

06/06/2015 at 05:13PM

14
#490 - Elizabeth / @sprinkles418

07/29/2015 at 07:24PM

14
#491 - Endre Galaczi / @galacziendre

08/10/2015 at 03:11PM

14
#492 - Mateusz / @foobar98765

10/31/2015 at 05:43PM

14
#493 - abbystasja / @abbystasja

12/21/2015 at 11:49PM

14
#494 - retro / @tryphopp

01/10/2016 at 08:51AM

14
#495 - Cristian Lupașcu / @clupasq

02/17/2016 at 10:31AM

14
#496 - eL Gee / @LauranceEl

02/29/2016 at 12:32AM

14
#497 - glepha / @glepha_vim

03/10/2016 at 05:11AM

14
#498 - Bogumił Kamiński / @BogumilKaminski

05/01/2016 at 09:31PM

14
#499 - Chris Armstrong / @ChrisATweets

06/08/2016 at 07:16PM

14
#500 - Tom McHenry / @tommchenry

08/24/2016 at 12:57AM

14
#501 - И К / @igorjan94

09/15/2016 at 08:18AM

14
#502 - Kyouma / @kyoumaJohn

10/14/2016 at 06:31PM

14
#503 - Dillon Kearns / @dillontkearns

12/12/2016 at 05:39AM

14
#504 - Миша Сорокин / @rafmikovi4

04/14/2017 at 10:55AM

14
#505 - Edouard Piette / @EdPiette

05/11/2017 at 11:44AM

14
#506 - Sam Ringleman / @theRingleman

09/29/2017 at 05:39PM

14
#507 - Petar Saulic / @gorillawarfare9

10/27/2017 at 12:20PM

14
#508 - Geoff / @RealGeoffErwin

12/18/2017 at 08:27PM

14
#509 - hails3 / @hails33

05/28/2018 at 04:23PM

14
#510 - Viktor Voronin / @voroninman

08/22/2018 at 09:36AM