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

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

253 active golfers, 710 entries

Solutions by @kimberlycreates:
34
#18 - kimber gonzalez / @kimberlycreates

01/22/2015 at 02:51PM

37
#>44 - kimber gonzalez / @kimberlycreates

01/22/2015 at 02:51PM

38
#>54 - kimber gonzalez / @kimberlycreates

01/22/2015 at 02:50PM

40
#>71 - kimber gonzalez / @kimberlycreates

01/22/2015 at 02:49PM

41
#>87 - kimber gonzalez / @kimberlycreates

01/22/2015 at 02:49PM

42
#>97 - kimber gonzalez / @kimberlycreates

01/22/2015 at 02:48PM

43
#>108 - kimber gonzalez / @kimberlycreates

01/22/2015 at 02:47PM

44
#>121 - kimber gonzalez / @kimberlycreates

01/22/2015 at 02:46PM

45
#>129 - kimber gonzalez / @kimberlycreates

01/22/2015 at 02:46PM

46
#>138 - kimber gonzalez / @kimberlycreates

01/22/2015 at 02:45PM

47
#>152 - kimber gonzalez / @kimberlycreates

01/22/2015 at 02:45PM

48
#>170 - kimber gonzalez / @kimberlycreates

01/22/2015 at 02:45PM

49
#>182 - kimber gonzalez / @kimberlycreates

01/22/2015 at 02:44PM

50
#>194 - kimber gonzalez / @kimberlycreates

01/22/2015 at 02:04PM