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 536cfa23fcccd100025678bd

Extract argument from function

The aim is to see if you can do some refactoring very fast.

Start file
attr("y",function(v){return v})
End file
f=function(v){return v};
attr("y",f)

View Diff

1c1,2
< attr("y",function(v){return v})
---
> f=function(v){return v};
> attr("y",f)

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 667 remaining solutions by signing in and submitting your own entry
#668 BitLad / @BitLad - Score: 30 - 01/31/18 @ 18:37
veeeexo<Esc>paf)<Esc>kIf=<Esc>A;<Esc>hx:w<CR>:wq<CR>

0 comments


Created by: @EdgarHipp

668 active golfers, 2000 entries

Leaderboard (lowest score wins):
14
#271 - Filipe Almeida / @filipe_almeida

12/31/2014 at 09:34AM

14
#272 - Carlos A Henríquez Q / @lagunex

01/18/2015 at 06:18PM

14
#273 - mark0829 / @mark0829

01/25/2015 at 01:42PM

14
#274 - no name / @vimgol

01/28/2015 at 06:35PM

14
#275 - xieyh11 / @xieyh11

02/16/2015 at 02:55AM

14
#276 - Naseem Al-Naji / @NaseemAlnaji

02/19/2015 at 09:53PM

14
#277 - Thiago Prado / @5k1pp3r

02/22/2015 at 01:11PM

14
#278 - Harold Pong / @har2po

02/26/2015 at 10:54AM

14
#279 - Raja Sharan Mamidala / @rajasharan

03/02/2015 at 03:33AM

14
#280 - Ala' Ibrahim / @alaa_ibrahim

03/10/2015 at 10:11AM

14
#281 - pftb12345 / @pftb12345

03/30/2015 at 12:39PM

14
#282 - ipson_nek / @ipson_nek

03/30/2015 at 03:29PM

14
#283 - Paul Diaconescu / @paulgtd

04/09/2015 at 06:39AM

14
#284 - Niels Madan / @nielsmadan

04/16/2015 at 12:50PM

14
#285 - Alex Birdsall / @gobslapped

04/20/2015 at 05:57PM

14
#286 - Dylan Hart / @code_problem

04/21/2015 at 06:57AM

14
#287 - Hao Deng / @haodeng

06/15/2015 at 12:29PM

14
#288 - Stefan Knudsen / @knud32

06/19/2015 at 08:13AM

14
#289 - Louis Burke / @LambdaABeta

07/07/2015 at 07:25PM

14
#290 - Dan Piponi / @sigfpe

07/21/2015 at 07:19PM

14
#291 - Peter B / @l0wm4x

08/12/2015 at 06:55PM

14
#292 - Blake Tereau / @BlakeTereau

08/17/2015 at 09:27PM

14
#293 - LC / @leeren

08/23/2015 at 12:09AM

14
#294 - Jon Nyman / @NymanJon

09/12/2015 at 10:31AM

14
#295 - Bogumił Kamiński / @BogumilKaminski

10/26/2015 at 03:52PM

14
#296 - Marty Boren / @computerliker

11/29/2015 at 01:04AM

14
#297 - Sean Stout / @s183s657

12/10/2015 at 04:05AM

14
#298 - Smylers / @Smylers2

02/11/2016 at 11:32AM

14
#299 - antew / @antewcode

03/01/2016 at 02:58PM

14
#300 - Chenut Ludovic / @7Brwa7

03/31/2016 at 10:06AM