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 4d1a522ea860b7447200010b

Braces or Brackets?

Someone forgot whether to use braces or brackets and you have to clean up their code!

Start file
var some_function = function {arg1, arg2} [
       
var some_array = (1, 2, 3, 4, 'foo');
       
for {var i in some_array} (
                console
.log(some_array, [{1 + (8 / 2)}, 'hello (world)');
       
)
];
End file
var some_function = function (arg1, arg2) {
       
var some_array = [1, 2, 3, 4, 'foo'];
       
for (var i in some_array) {
                console
.log(some_array, [(1 + (8 / 2)), 'hello (world)');
       
}
};

View Diff

1,6c1,6
< var some_function = function {arg1, arg2} [
<       var some_array = (1, 2, 3, 4, 'foo');
<       for {var i in some_array} (
<               console.log(some_array, [{1 + (8 / 2)}, 'hello (world)');
<       )
< ];
---
> var some_function = function (arg1, arg2) {
>       var some_array = [1, 2, 3, 4, 'foo'];
>       for (var i in some_array) {
>               console.log(some_array, [(1 + (8 / 2)), 'hello (world)');
>       }
> };

Solutions by @junfeng:

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

326 active golfers, 1057 entries

Solutions by @junfeng:
35
#47 - Junfeng / @junfeng

07/15/2011 at 07:53AM

37
#>61 - Junfeng / @junfeng

07/15/2011 at 07:48AM

38
#>72 - Junfeng / @junfeng

07/15/2011 at 07:46AM

39
#>81 - Junfeng / @junfeng

07/15/2011 at 07:43AM

41
#>103 - Junfeng / @junfeng

07/15/2011 at 07:36AM

43
#>138 - Junfeng / @junfeng

07/15/2011 at 07:30AM

44
#>150 - Junfeng / @junfeng

07/15/2011 at 07:23AM