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 56eb0843251cf25ae40963de

underscore_to_camelCase

Pointy haired boss decided we need to switch to camelCase. Let's get this over with.

Start file
log(req, res, next) {
    try {
        let ratio = this.config.get("HEADER_LOG_FREQ", 0.05);
        if (Math.random() < ratio) {
            this.arrange_headers(req, res).then(this.write_log);
        }
        let safe_path = this.safe_graphite_path(req.path);
        this.stats.increment("web.endpoint." + safe_path, 1, 0.05);
        if (req.headers && req.headers["x-forwarded-proto"]) {
            this.stats.increment("web.protocol." + req.headers["x-forwarded-proto"], 1, 0.05);
        }
    } catch (error) {
        log.warning(error, "Failed to log headers");
        res.status(500).send("its_not_you_its_me");
    } finally {
        next();
    }
}
End file
log(req, res, next) {
    try {
        let ratio = this.config.get("HEADER_LOG_FREQ", 0.05);
        if (Math.random() < ratio) {
            this.arrangeHeaders(req, res).then(this.writeLog);
        }
        let safePath = this.safeGraphitePath(req.path);
        this.stats.increment("web.endpoint." + safePath, 1, 0.05);
        if (req.headers && req.headers["x-forwarded-proto"]) {
            this.stats.increment("web.protocol." + req.headers["x-forwarded-proto"], 1, 0.05);
        }
    } catch (error) {
        log.warning(error, "Failed to log headers");
        res.status(500).send("its_not_you_its_me");
    } finally {
        next();
    }
}

View Diff

5c5
<             this.arrange_headers(req, res).then(this.write_log);
---
>             this.arrangeHeaders(req, res).then(this.writeLog);
7,8c7,8
<         let safe_path = this.safe_graphite_path(req.path);
<         this.stats.increment("web.endpoint." + safe_path, 1, 0.05);
---
>         let safePath = this.safeGraphitePath(req.path);
>         this.stats.increment("web.endpoint." + safePath, 1, 0.05);

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 52 remaining solutions by signing in and submitting your own entry
#53 Robber Toe / robbertoe - Score: 16 - 04/01/16 @ 01:14
/_<CR>nnqqx~nq5@qZZ

0 comments

#54 Clémence / Clemence_Neoxia - Score: 16 - 04/14/16 @ 07:44
/e_<CR>qqlx~nq5@qZZ

0 comments

#55 Michał Dytko / DytkoM - Score: 16 - 12/28/16 @ 09:38
/_<CR>nnqqx~nq5@qZZ

0 comments

#56 Assaf Lavie / AssafLavie - Score: 21 - 03/17/16 @ 19:47
4jqqf_x~q@q<CR><CR>3@qj@qZZ

0 comments

#57 basilest / basilest - Score: 21 - 03/18/16 @ 00:04
qq/_[hlgp]\C<CR>x~q5@qZZ

0 comments

#58 Gurukandhamoorthi / Gurukandhamoor1 - Score: 21 - 07/20/17 @ 15:26
5Gqqf_x~q@q<CR><CR>3@qj@@ZZ

0 comments

#59 matt_todd / matt_todd - Score: 22 - 04/15/16 @ 23:39
:%s/e_\(.\)/e\u\1/g<CR>ZZ

0 comments

#60 Michael Prouty / MProuts - Score: 23 - 03/20/16 @ 17:22
:.,8s:_\(\l\):\u\1:g<CR>ZZ

0 comments

#61 Christian Rondeau / c_rondeau - Score: 24 - 10/18/16 @ 01:58
/_<CR>nnx~nx~nx~nx~nx~nx~ZZ

0 comments

#62 Marcel Akkerman / MarcelAkkerman - Score: 24 - 12/22/16 @ 12:27
:nm w f_x~<CR>5Gww++wwwjwZZ

0 comments

#63 Alexander Pivovarov / pivizz - Score: 25 - 03/19/16 @ 19:35
/_<CR>nnx~nx~nx~nx~nx~nx~nZZ

0 comments

#64 Kevin Ilphrin Pellet / Kilphrin - Score: 26 - 03/17/16 @ 21:33
4jqqf_x~q@a@q<CR><CR>@q2@qj@q:x<CR>

0 comments

#65 Bruce Park / bpark0 - Score: 26 - 03/21/16 @ 00:22
4jqqf_x~q@a@q<CR><CR>@q2@qj@q:x<CR>

0 comments

#66 Sebastian Pfluegelm / sebastian_pflgl - Score: 35 - 06/04/16 @ 22:31
/_n<BS><CR>nnxrHnxRL<Esc>nxrPnxrGnxrPnxrP:wq<CR>

0 comments

Created by: AssafLavie

66 active golfers, 128 entries

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

03/17/2016 at 08:26PM

14
#2 - Jon Krause / jkrause314

03/17/2016 at 08:40PM

14
#3 - Kyle Holzinger / kyleholzinger

03/18/2016 at 03:45AM

14
#4 - Smylers / Smylers2

03/18/2016 at 09:41AM

14
#5 - Dimitar Dimitrov / kurkale6ka

03/18/2016 at 11:34AM

14
#6 - Jiří Chára / JiriChara

03/18/2016 at 12:05PM

14
#7 - John Braxler / braxler

03/18/2016 at 09:51PM

14
#8 - Jonathan Taylor / Jonyonson

03/19/2016 at 04:55AM

14
#9 - Hao Chen / Chen_Hao

03/19/2016 at 08:48AM

14
#10 - tullie / tulliemurrell

03/20/2016 at 03:21PM

14
#11 - Jan Bundesmann / ixjab

03/21/2016 at 08:55AM

14
#12 - Robert Mosher / rcmosher

03/21/2016 at 07:15PM

14
#13 - Jason Choi / joyous_jason

03/22/2016 at 11:04AM

14
#14 - Neelo / Neelo_Bullet

03/22/2016 at 03:59PM

14
#15 - Dinesh Bhosale / MrDineshBhosale

03/30/2016 at 01:04PM

14
#16 - CM Déjardin ن / CMDej

04/14/2016 at 08:22AM

14
#17 - E Both / enboth

04/14/2016 at 10:20AM

14
#18 - S O / strangelooperer

04/17/2016 at 08:15PM

14
#19 - T. Sakuma / taku39

05/01/2016 at 01:59PM

14
#20 - John Goes / johnwgoes

05/08/2016 at 12:05PM

14
#21 - Nico Gevers / ingevious

05/08/2016 at 06:21PM

14
#22 - Atrament / Atrament

05/11/2016 at 05:05PM

14
#23 - (,,꒪꒫꒪,,) / sneer

05/21/2016 at 11:48AM

14
#24 - Benedikt Breinbauer / benebun

07/24/2016 at 05:59PM

14
#25 - Will / obiwan__k3n00bi

09/01/2016 at 06:20AM

14
#26 - Stanislav / prstad

10/25/2016 at 12:51PM

15
#27 - Cristian Lupașcu / clupasq

03/17/2016 at 08:32PM

15
#28 - Jason Schulz / uxcn_

03/18/2016 at 12:15AM

15
#29 - glepha / glepha_vim

03/18/2016 at 06:05AM

15
#30 - Saki Gw / Sakigw

03/18/2016 at 09:40AM

15
#31 - Samuel Masuy / samasuy

03/18/2016 at 12:12PM

15
#32 - James / Dronak

03/18/2016 at 02:08PM

15
#33 - Joey Marianer / roie_m

03/19/2016 at 04:04PM

15
#34 - Dimitrije Juras / sinemitre

03/19/2016 at 04:48PM

15
#35 - lorentrogers / lorentrogers

03/20/2016 at 11:39AM

15
#36 - Lau Chi Yung / asdsteven2

03/22/2016 at 11:12AM

15
#37 - Carlos A Henríquez Q / lagunex

03/26/2016 at 02:02PM

15
#38 - Philiphone / Philiphone

03/29/2016 at 10:36AM

15
#39 - ushumpei / funnel_mune

03/29/2016 at 05:24PM

15
#40 - Chenut Ludovic / 7Brwa7

03/31/2016 at 08:15PM

15
#41 - Rao Zvorovski / RaoZvorovski

04/02/2016 at 03:04PM

15
#42 - Omer Lachish / rauchy

04/03/2016 at 09:40AM

15
#43 - Vaughn Cato / vaughncato

04/10/2016 at 12:48PM

15
#44 - Andres Araya / arayaandresfco

05/15/2016 at 06:49PM

15
#45 - Ram Tamtam / ramtamtamtam

06/27/2016 at 01:46PM

15
#46 - Oliver Christ / 0liverChrist

07/12/2016 at 10:55PM

15
#47 - TweetDreams / TweetMusicians

10/16/2016 at 10:28PM

15
#48 - Raymond Chee / rchomium

03/05/2017 at 04:56PM

15
#49 - Daniel / Daniel00288663

03/31/2017 at 10:00AM

16
#50 - hans peter / mullovc

03/25/2016 at 08:06PM

16
#51 - Stoyko Stanchev / stoykostanchev

03/28/2016 at 01:23PM

16
#52 - lilach adir / leelaRed

03/31/2016 at 09:11AM

16
#53 - Robber Toe / robbertoe

04/01/2016 at 01:14AM

16
#54 - Clémence / Clemence_Neoxia

04/14/2016 at 07:44AM

16
#55 - Michał Dytko / DytkoM

12/28/2016 at 09:38AM

21
#56 - Assaf Lavie / AssafLavie

03/17/2016 at 07:47PM

21
#57 - basilest / basilest

03/18/2016 at 12:04AM

21
#58 - Gurukandhamoorthi / Gurukandhamoor1

07/20/2017 at 03:26PM

22
#59 - matt_todd / matt_todd

04/15/2016 at 11:39PM

23
#60 - Michael Prouty / MProuts

03/20/2016 at 05:22PM

24
#61 - Christian Rondeau / c_rondeau

10/18/2016 at 01:58AM

24
#62 - Marcel Akkerman / MarcelAkkerman

12/22/2016 at 12:27PM

25
#63 - Alexander Pivovarov / pivizz

03/19/2016 at 07:35PM

26
#64 - Kevin Ilphrin Pellet / Kilphrin

03/17/2016 at 09:33PM

26
#65 - Bruce Park / bpark0

03/21/2016 at 12:22AM

35
#66 - Sebastian Pfluegelm / sebastian_pflgl

06/04/2016 at 10:31PM