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):
15
#541 - Underhill Labs / @underhilllabs

10/30/2012 at 04:38AM

15
#542 - Adam Dratwinski / @adwinsky

11/27/2012 at 07:46PM

15
#543 - Casey Robinson / @rampant_monkey

12/05/2012 at 09:32PM

15
#544 - zmf_tim / @zmf_tim

07/13/2013 at 06:31AM

15
#545 - fSchl / @FelixSchlitter

07/15/2013 at 08:20PM

15
#546 - James / @Dronak

08/29/2013 at 02:37PM

15
#547 - foo / @foo88832727

10/18/2013 at 08:04PM

15
#548 - Chris Ford / @ctford

10/20/2013 at 12:38PM

15
#549 - mwcz / @mwcz

11/01/2013 at 06:16PM

15
#550 - Mathieu Larouche / @matdube

11/19/2013 at 11:41AM

15
#551 - Larry Boltovskoi / @larrybolt

12/08/2013 at 01:40AM

15
#552 - Brian Peiris / @brianpeiris

12/28/2013 at 05:49AM

15
#553 - Johan Berg / @_berg85

01/24/2014 at 02:57PM

15
#554 - Hyper Bovine / @hyperbovine

01/29/2014 at 05:19AM

15
#555 - mattsalacain / @mattsalacain

02/04/2014 at 05:24AM

15
#556 - Ben Lambeth / @azy2_ben

02/13/2014 at 12:00AM

15
#557 - Robert Siemieniec / @rsiemieniec

03/12/2014 at 04:29PM

15
#558 - Felipe Jaramillo F / @mrfelipe

04/01/2014 at 09:32PM

15
#559 - Lance Levine / @LanceSMLevine

04/02/2014 at 05:18AM

15
#560 - mathac / @mathacgolf

05/05/2014 at 07:34AM

15
#561 - Victor Bjelkholm / @VictorBjelkholm

06/02/2014 at 10:21PM

15
#562 - Francisco García / @SystematicFrank

06/24/2014 at 11:35AM

15
#563 - _ / @klawh3

07/12/2014 at 01:39AM

15
#564 - fa / @twiteciop

08/07/2014 at 12:52PM

15
#565 - Tj / @yrddy

08/13/2014 at 08:12AM

15
#566 - Rolen Le / @RolenTLe

09/26/2014 at 07:33PM

15
#567 - jptomoya / @_jptomoya

10/18/2014 at 07:47AM

15
#568 - SilentFl / @Silent_Fl

01/27/2015 at 09:56AM

15
#569 - d1uckym d1uckym / @d1uckym

02/18/2015 at 08:13PM

15
#570 - Wilmer Bandres / @WilmerBandres

12/17/2015 at 06:34PM