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

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

284 active golfers, 870 entries

Solutions by @zulolosi:
34
#15 - Petro Тrouq / @zulolosi

03/27/2013 at 12:26AM

35
#>36 - Petro Тrouq / @zulolosi

03/27/2013 at 12:25AM

37
#>55 - Petro Тrouq / @zulolosi

03/27/2013 at 12:25AM

38
#>64 - Petro Тrouq / @zulolosi

03/27/2013 at 12:24AM

40
#>80 - Petro Тrouq / @zulolosi

03/27/2013 at 12:22AM

41
#>96 - Petro Тrouq / @zulolosi

03/27/2013 at 12:22AM

42
#>110 - Petro Тrouq / @zulolosi

03/27/2013 at 12:18AM

43
#>124 - Petro Тrouq / @zulolosi

03/27/2013 at 12:10AM

43
#>124 - Petro Тrouq / @zulolosi

03/27/2013 at 12:20AM

44
#>136 - Petro Тrouq / @zulolosi

03/27/2013 at 12:08AM

45
#>145 - Petro Тrouq / @zulolosi

03/27/2013 at 12:07AM

46
#>152 - Petro Тrouq / @zulolosi

03/27/2013 at 12:07AM

47
#>167 - Petro Тrouq / @zulolosi

03/27/2013 at 12:06AM

48
#>188 - Petro Тrouq / @zulolosi

03/27/2013 at 12:05AM

49
#>201 - Petro Тrouq / @zulolosi

03/27/2013 at 12:00AM

50
#>214 - Petro Тrouq / @zulolosi

03/27/2013 at 12:00AM

51
#>224 - Petro Тrouq / @zulolosi

03/26/2013 at 11:56PM

52
#>233 - Petro Тrouq / @zulolosi

03/26/2013 at 11:55PM