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

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

253 active golfers, 710 entries

Solutions by @jpiasetz:
34
#4 - John Piasetzki / @jpiasetz

07/13/2012 at 03:56AM

35
#>28 - John Piasetzki / @jpiasetz

07/13/2012 at 04:06AM

35
#>28 - John Piasetzki / @jpiasetz

07/13/2012 at 04:10AM

37
#>40 - John Piasetzki / @jpiasetz

07/13/2012 at 03:52AM

38
#>53 - John Piasetzki / @jpiasetz

07/13/2012 at 03:51AM

39
#>59 - John Piasetzki / @jpiasetz

07/13/2012 at 03:43AM

41
#>78 - John Piasetzki / @jpiasetz

07/13/2012 at 03:40AM

42
#>96 - John Piasetzki / @jpiasetz

07/13/2012 at 03:35AM

43
#>107 - John Piasetzki / @jpiasetz

07/13/2012 at 03:17AM

44
#>117 - John Piasetzki / @jpiasetz

07/13/2012 at 03:11AM

46
#>133 - John Piasetzki / @jpiasetz

07/13/2012 at 03:04AM

112
#>251 - John Piasetzki / @jpiasetz

07/13/2012 at 02:57AM