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 754 remaining solutions by signing in and submitting your own entry
#755 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

755 active golfers, 2364 entries

Leaderboard (lowest score wins):
14
#301 - Peter Strawson / @PeterStrawson

08/04/2014 at 02:06AM

14
#302 - PLS / @jaegd

08/05/2014 at 09:55PM

14
#303 - April Gentle / @chen327684096

08/26/2014 at 03:54PM

14
#304 - Michael Comerford / @MComerford1

09/17/2014 at 01:14AM

14
#305 - Bob Davison / @bobd91

09/23/2014 at 08:28PM

14
#306 - simonced / @simonced

09/28/2014 at 03:14AM

14
#307 - Narek / @NarekCat

10/10/2014 at 07:37PM

14
#308 - Eduardo / @earada

10/22/2014 at 03:42PM

14
#309 - Mauro Persano / @fzort

11/15/2014 at 07:39PM

14
#310 - Matt / @mcr05

11/26/2014 at 10:30AM

14
#311 - Test User / @TestUserIgnore

12/04/2014 at 09:50PM

14
#312 - Josu Oyanguren / @josuoyanguren

12/18/2014 at 04:39PM

14
#313 - Filipe Almeida / @filipe_almeida

12/31/2014 at 09:34AM

14
#314 - Carlos A HenrĂ­quez Q / @lagunex

01/18/2015 at 06:18PM

14
#315 - mark0829 / @mark0829

01/25/2015 at 01:42PM

14
#316 - no name / @vimgol

01/28/2015 at 06:35PM

14
#317 - xieyh11 / @xieyh11

02/16/2015 at 02:55AM

14
#318 - Naseem Al-Naji / @NaseemAlnaji

02/19/2015 at 09:53PM

14
#319 - Thiago Prado / @5k1pp3r

02/22/2015 at 01:11PM

14
#320 - Harold Pong / @har2po

02/26/2015 at 10:54AM

14
#321 - Raja Sharan Mamidala / @rajasharan

03/02/2015 at 03:33AM

14
#322 - Ala' Ibrahim / @alaa_ibrahim

03/10/2015 at 10:11AM

14
#323 - pftb12345 / @pftb12345

03/30/2015 at 12:39PM

14
#324 - ipson_nek / @ipson_nek

03/30/2015 at 03:29PM

14
#325 - Paul Diaconescu / @paulgtd

04/09/2015 at 06:39AM

14
#326 - Niels Madan / @nielsmadan

04/16/2015 at 12:50PM

14
#327 - Alex Birdsall / @gobslapped

04/20/2015 at 05:57PM

14
#328 - Dylan Hart / @code_problem

04/21/2015 at 06:57AM

14
#329 - Hao Deng / @haodeng

06/15/2015 at 12:29PM

14
#330 - Stefan Knudsen / @knud32

06/19/2015 at 08:13AM