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 511991607729fb0002000003

Refactor arguments into object argument

A relatively common Javascript refactoring.

Start file
function foo(hello, world,
             how, are,
             you) {
}
End file
function foo(parameters) {
    var hello = parameters.hello;
    var world = parameters.world;
    var how = parameters.how;
    var are = parameters.are;
    var you = parameters.you;
}

View Diff

1,3c1,6
< function foo(hello, world,
<              how, are,
<              you) {
---
> function foo(parameters) {
>     var hello = parameters.hello;
>     var world = parameters.world;
>     var how = parameters.how;
>     var are = parameters.are;
>     var you = parameters.you;

Solutions by @bszonye:

Unlock 9 remaining solutions by signing in and submitting your own entry
Created by: @blingcoder

68 active golfers, 166 entries

Solutions by @bszonye:
50
#6 - Bradd Szonye / @bszonye

07/13/2013 at 11:39AM

52
#>10 - Bradd Szonye / @bszonye

07/13/2013 at 11:15AM

56
#>15 - Bradd Szonye / @bszonye

07/13/2013 at 11:12AM

57
#>16 - Bradd Szonye / @bszonye

07/13/2013 at 11:00AM

59
#>23 - Bradd Szonye / @bszonye

07/13/2013 at 10:50AM

60
#>25 - Bradd Szonye / @bszonye

07/13/2013 at 10:42AM

64
#>26 - Bradd Szonye / @bszonye

07/13/2013 at 10:22AM

74
#>48 - Bradd Szonye / @bszonye

07/13/2013 at 10:09AM

75
#>49 - Bradd Szonye / @bszonye

07/13/2013 at 10:04AM