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

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

315 active golfers, 1015 entries

Solutions by @vimrocks:
34
#9 - Vim rocks / @vimrocks

10/06/2012 at 11:38AM

37
#>62 - Vim rocks / @vimrocks

10/06/2012 at 11:34AM

38
#>74 - Vim rocks / @vimrocks

10/06/2012 at 11:31AM

40
#>92 - Vim rocks / @vimrocks

10/06/2012 at 11:26AM

41
#>104 - Vim rocks / @vimrocks

10/06/2012 at 11:20AM

42
#>122 - Vim rocks / @vimrocks

10/06/2012 at 11:14AM

43
#>136 - Vim rocks / @vimrocks

10/06/2012 at 11:11AM

44
#>148 - Vim rocks / @vimrocks

10/06/2012 at 11:07AM

45
#>159 - Vim rocks / @vimrocks

10/06/2012 at 11:04AM

52
#>253 - Vim rocks / @vimrocks

10/06/2012 at 10:58AM

53
#>258 - Vim rocks / @vimrocks

10/06/2012 at 10:50AM