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

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

314 active golfers, 1014 entries

Solutions by @mabeyj:
34
#12 - Jimmy Mabey / @mabeyj

01/20/2013 at 02:26AM

36
#>51 - Jimmy Mabey / @mabeyj

01/20/2013 at 02:21AM

37
#>63 - Jimmy Mabey / @mabeyj

01/20/2013 at 02:05AM

37
#>63 - Jimmy Mabey / @mabeyj

01/20/2013 at 02:19AM

38
#>74 - Jimmy Mabey / @mabeyj

01/20/2013 at 01:59AM

39
#>80 - Jimmy Mabey / @mabeyj

01/20/2013 at 01:53AM

41
#>107 - Jimmy Mabey / @mabeyj

01/20/2013 at 01:47AM

47
#>184 - Jimmy Mabey / @mabeyj

01/20/2013 at 01:36AM