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 666 remaining solutions by signing in and submitting your own entry
#667 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

667 active golfers, 2152 entries

Leaderboard (lowest score wins):
18
#631 - Christopher Biscardi / @chrisbiscardi

07/17/2012 at 07:21AM

18
#632 - pikaren / @REALpikaren

12/22/2013 at 09:28AM

18
#633 - David M / @ohhhmandyyy

01/15/2014 at 11:24PM

18
#634 - Hannes Tydén / @pht

08/08/2014 at 11:32PM

18
#635 - Mike Herrera / @crftr

01/31/2016 at 10:43PM

18
#636 - James Vaughan / @jamesontheline

06/04/2020 at 08:45PM

18
#637 - Kristijan Husak / @kristijan_husak

09/29/2022 at 03:03PM

19
#638 - Lajos Koszti / @Ajnasz

06/04/2012 at 02:52PM

19
#639 - Святослав Сюрин / @rmrfhome

06/11/2012 at 01:16PM

19
#640 - Zach Kemp / @zvksf

12/18/2013 at 04:47PM

19
#641 - stb tra / @stbtra

01/29/2014 at 05:16AM

19
#642 - Feras / @faldah

05/02/2016 at 02:07AM

19
#643 - Gurukandhamoorthi / @Gurukandhamoor1

07/11/2017 at 02:03PM

20
#644 - BartJanssen / @BartJanssen

03/12/2015 at 10:06PM

21
#645 - Philippe Creux / @pcreux

07/13/2012 at 06:44AM

21
#646 - Artur Chruszcz / @a_chru

09/15/2013 at 01:52PM

21
#647 - Alberto Pose / @thepose

11/06/2013 at 06:04PM

21
#648 - Nick Haliday / @nick_haliday

05/21/2020 at 04:19AM

22
#649 - Gowtham Madhava / @gowthamgowtham

07/02/2012 at 04:54PM

22
#650 - Justin Fisher / @justinfisherr

11/04/2024 at 04:40PM

23
#651 - Tyler Breisacher / @tbreisacher

08/25/2012 at 07:40AM

25
#652 - Howard / @h0w412d

07/16/2012 at 02:53AM

25
#653 - Korbinian Stoemmer / @PaulSmecker

03/08/2013 at 01:15PM

25
#654 - DeusExHominis / @DeusExHominis

02/18/2015 at 04:39AM

26
#655 - Julian / @JulianGindi

02/28/2016 at 06:39PM

26
#656 - Shunichi Kanade / @shunkana

12/02/2018 at 10:03AM

27
#657 - Noel Alejandro / @noelrock333

06/22/2012 at 11:03PM

27
#658 - Radu Bogdan Croitoru / @dotx

02/21/2014 at 11:19PM

28
#659 - Dustin Willis Webber / @Mephux

08/28/2012 at 04:29PM

28
#660 - Aaron / @_Lordofthevoid_

12/03/2019 at 05:12PM