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
#451 - Viswanath Sivakumar / @viswanathgs

08/30/2012 at 06:31PM

14
#452 - Rohith Ravi / @entombedvirus

08/30/2012 at 11:25PM

14
#453 - jakeroberts / @jakeroberts

09/07/2012 at 06:50AM

14
#454 - Andrew Honig / @AndyKHonig

09/09/2012 at 03:03AM

14
#455 - Miguel Sánchez / @miguelsr1987

10/02/2012 at 11:50AM

14
#456 - Leigh Bicknell / @LeighBicknell

10/09/2012 at 11:58AM

14
#457 - Zbigniew Siciarz / @zsiciarz

11/18/2012 at 08:27PM

14
#458 - Claudio Ortolina / @cloud8421

11/27/2012 at 08:02PM

14
#459 - nicolas bo / @thevegeta

12/06/2012 at 10:10AM

14
#460 - Tyler / @tylerbindon

04/02/2013 at 07:20AM

14
#461 - Jean Benoit / @jeanbenoit123

04/27/2013 at 01:13PM

14
#462 - Clinton シ / @iblamefish

05/11/2013 at 01:16PM

14
#463 - Joe Sullivan / @itsjoesullivan

06/19/2013 at 06:31AM

14
#464 - Justin Le / @mstk

07/24/2013 at 07:59AM

14
#465 - Bart of Denver / @bartofdenver

08/12/2013 at 02:08PM

14
#466 - Alexander / @usr_noid

08/22/2013 at 07:22AM

14
#467 - Luis Visintini / @lvisintini

08/27/2013 at 07:27PM

14
#468 - engy / @engydmw

09/02/2013 at 08:59PM

14
#469 - Fernando Axel Ellis / @Axel_Ellis

09/17/2013 at 02:59PM

14
#470 - Oliver Christ / @0liverChrist

09/25/2013 at 02:22PM

14
#471 - Billy Ripper / @dirtlamb5

10/15/2013 at 10:03PM

14
#472 - Pawel Ceranka / @pawelceranka

10/17/2013 at 11:04AM

14
#473 - dickbutt / @ryan_haynes

10/24/2013 at 10:17PM

14
#474 - Sam Burk / @smwbk

12/21/2013 at 04:28AM

14
#475 - ren / @wxoc

02/26/2014 at 01:59AM

14
#476 - Peter Strawson / @PeterStrawson

04/09/2014 at 03:41AM

14
#477 - ZorgroZ / @ZorgroZ

04/12/2014 at 03:23PM

14
#478 - CJ Avilla / @cjav_dev

05/10/2014 at 04:47AM

14
#479 - Kyle Travis / @kmakai

05/16/2014 at 06:30PM

14
#480 - Sntano Euhsk / @SEuhsk

06/02/2014 at 08:28PM