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

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

315 active golfers, 1015 entries

Solutions by @YannMoisan:
34
#13 - Yann Moisan / @YannMoisan

02/01/2013 at 02:46PM

37
#>63 - Yann Moisan / @YannMoisan

02/01/2013 at 02:39PM

38
#>74 - Yann Moisan / @YannMoisan

02/01/2013 at 02:11PM

44
#>149 - Yann Moisan / @YannMoisan

02/01/2013 at 02:04PM

46
#>167 - Yann Moisan / @YannMoisan

02/01/2013 at 01:57PM

54
#>266 - Yann Moisan / @YannMoisan

01/01/2013 at 08:44PM

57
#>279 - Yann Moisan / @YannMoisan

01/01/2013 at 08:35PM

92
#>307 - Yann Moisan / @YannMoisan

01/01/2013 at 08:19PM