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

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

315 active golfers, 1015 entries

Solutions by @alimoeeny:
40
#89 - Ali Moeeny MD PhD / @alimoeeny

12/14/2011 at 08:16PM

42
#>120 - Ali Moeeny MD PhD / @alimoeeny

12/14/2011 at 08:13PM

43
#>134 - Ali Moeeny MD PhD / @alimoeeny

12/14/2011 at 08:08PM

44
#>145 - Ali Moeeny MD PhD / @alimoeeny

12/14/2011 at 08:00PM

45
#>157 - Ali Moeeny MD PhD / @alimoeeny

12/14/2011 at 07:54PM

45
#>157 - Ali Moeeny MD PhD / @alimoeeny

12/14/2011 at 08:05PM

49
#>214 - Ali Moeeny MD PhD / @alimoeeny

12/14/2011 at 07:33PM

49
#>214 - Ali Moeeny MD PhD / @alimoeeny

12/14/2011 at 07:39PM

49
#>214 - Ali Moeeny MD PhD / @alimoeeny

12/14/2011 at 07:43PM

51
#>242 - Ali Moeeny MD PhD / @alimoeeny

12/14/2011 at 06:13PM

51
#>242 - Ali Moeeny MD PhD / @alimoeeny

12/14/2011 at 07:52PM

63
#>289 - Ali Moeeny MD PhD / @alimoeeny

12/14/2011 at 07:28PM

65
#>291 - Ali Moeeny MD PhD / @alimoeeny

12/14/2011 at 02:58PM