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 51093f4c6db41b0002000003

Define to require

When JSHint is enabled, there's a rule that doesn't let you have more than 6 arguments in a function, so the moment you need to add a 7th argument, you need to do a refactoring.

Start file
define(
    [
        'jquery',
        'underscore',
        'json',
        'benchmark',
        'coffee',
        'beans',
        'hello'
    ],
    function($, _, json, benchmark, coffee, beans, hello) {
    });
End file
define(function(require) {
    var $ = require('jquery');
    var _ = require('underscore');
    var json = require('json');
    var benchmark = require('benchmark');
    var coffee = require('coffee');
    var beans = require('beans');
    var hello = require('hello');
});

View Diff

1,12c1,9
< define(
<     [
<         'jquery',
<         'underscore',
<         'json',
<         'benchmark',
<         'coffee',
<         'beans',
<         'hello'
<     ],
<     function($, _, json, benchmark, coffee, beans, hello) {
<     });
---
> define(function(require) {
>     var $ = require('jquery');
>     var _ = require('underscore');
>     var json = require('json');
>     var benchmark = require('benchmark');
>     var coffee = require('coffee');
>     var beans = require('beans');
>     var hello = require('hello');
> });

Solutions

The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!

Check out these helpful resources to improve your Vim skills... Game on.

Unlock 45 remaining solutions by signing in and submitting your own entry
#46 jonlorusso / @jonlorusso - Score: 291 - 04/26/13 @ 21:27
:set paste<CR>vGCdefine(function(require) {<CR>    var $ = require('jquery');<CR>    var _ = require('underscore');<CR>    var json = require('json');<CR>    var benchmark = require('benchmark');<CR>    var coffee = require('coffee');<CR>    var beans = require('beans');<CR>    var hello = require('hello');<CR>});<Esc>ZZ

0 comments


Created by: @blingcoder

46 active golfers, 113 entries

Leaderboard (lowest score wins):
62
#1 - Urtica dioica / @udioica

01/30/2013 at 11:56PM

62
#2 - Victor Ramirez / @virako

02/02/2013 at 01:45AM

62
#3 - Andrew Hlavats / @farthestworld

03/21/2013 at 10:00PM

62
#4 - Chasetopher / @chasetopherlee

04/27/2013 at 08:34AM

62
#5 - Petro Тrouq / @zulolosi

07/04/2013 at 08:59PM

62
#6 - Bradd Szonye / @bszonye

07/14/2013 at 10:35AM

62
#7 - Ingo / @ist3fani

07/29/2013 at 05:46PM

62
#8 - John Braxler / @braxler

05/30/2014 at 06:51PM

63
#9 - Vito / @GodFather

02/25/2013 at 06:07AM

65
#10 - Marco Hinz / @_mhinz_

01/30/2013 at 11:17PM

65
#11 - wushexu / @wushexu

05/29/2013 at 10:43AM

67
#12 - zealotrush / @zealotrush

01/31/2013 at 06:54AM

69
#13 - Asmund / @herrasbe

01/31/2013 at 09:22PM

69
#14 - Jon Krause / @jkrause314

12/11/2015 at 09:38PM

75
#15 - Trevor Powell / @DoomedBunnies

02/05/2013 at 06:21AM

75
#16 - Daniel Lundin / @danielundin

02/13/2013 at 03:44PM

75
#17 - Ram Tamtam / @ramtamtamtam

07/07/2014 at 04:03PM

77
#18 - Pawel Obrok / @mrYapee

01/30/2013 at 10:44PM

78
#19 - Øystein Walle / @oysteinwalle

01/30/2013 at 10:19PM

78
#20 - Steve Tjoa / @stevetjoa

01/31/2013 at 02:56AM

78
#21 - cj / @cj01101

08/20/2013 at 05:14PM

79
#22 - Yann Moisan / @YannMoisan

01/31/2013 at 10:28PM

81
#23 - Forrest Zeisler / @fzeisler

04/28/2013 at 03:04PM

82
#24 - Kai Yuan / @kentyuan

02/23/2013 at 02:12AM

82
#25 - 전영식 / @garam111

02/28/2013 at 07:40AM

85
#26 - sfoo / @sfoo

02/24/2013 at 12:16AM

87
#27 - Andrew Burgess / @andrew8088

03/09/2013 at 06:37PM

88
#28 - Ben Zittlau / @benzittlau

04/26/2013 at 08:26PM

89
#29 - Christopher Harrison / @Xophmeister

01/30/2013 at 04:45PM

89
#30 - Runar / @runarfu

01/30/2013 at 06:53PM