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 @davis_cromwell:

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

652 active golfers, 2082 entries

Solutions by @davis_cromwell:
11
#116 - Mike Adams / @davis_cromwell

10/04/2015 at 12:02AM

12
#>273 - Mike Adams / @davis_cromwell

10/04/2015 at 12:00AM

13
#>395 - Mike Adams / @davis_cromwell

10/03/2015 at 11:58PM

14
#>480 - Mike Adams / @davis_cromwell

10/03/2015 at 11:57PM

15
#>558 - Mike Adams / @davis_cromwell

10/03/2015 at 11:54PM

16
#>597 - Mike Adams / @davis_cromwell

10/03/2015 at 11:51PM

19
#>627 - Mike Adams / @davis_cromwell

10/03/2015 at 11:52PM