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 by @CodingInRhythm:

Unlock 4 remaining solutions by signing in and submitting your own entry
Created by: @Ajnasz

677 active golfers, 2192 entries

Solutions by @CodingInRhythm:
17
#640 - Alex Clough / @CodingInRhythm

03/09/2026 at 02:43AM

18
#>647 - Alex Clough / @CodingInRhythm

03/09/2026 at 02:41AM

20
#>655 - Alex Clough / @CodingInRhythm

03/09/2026 at 02:40AM

28
#>671 - Alex Clough / @CodingInRhythm

03/09/2026 at 02:37AM