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

728 active golfers, 2215 entries

Leaderboard (lowest score wins):
14
#361 - Arno / @arnoxmp

05/08/2019 at 08:48PM

14
#362 - Phoon / @justflashhim

05/10/2019 at 10:39PM

14
#363 - albalitz / @_albalitz

06/06/2019 at 01:01PM

14
#364 - José / @AngelGaldamez

08/31/2019 at 06:00AM

14
#365 - monaqa / @mo_naqa

09/16/2019 at 10:29AM

14
#366 - Baine Wedlock / @BaineWedlock

09/24/2019 at 12:44PM

14
#367 - Lory / @Lory46845742

11/13/2019 at 09:04AM

14
#368 - Jason Neylon / @jasonneylon

02/23/2020 at 10:42AM

14
#369 - 薛浩滎 / @iTPChbTeI4ZW9s3

03/17/2020 at 10:41PM

14
#370 - floyd / @floyd10086

03/27/2020 at 07:21AM

14
#371 - eshel / @EshelBM

03/29/2020 at 06:29PM

14
#372 - iBhagwan / @iiBhagwan

05/15/2020 at 12:03AM

14
#373 - Moatvald / @moatvald

05/15/2020 at 02:31PM

14
#374 - Sven H. / @mostley

11/18/2020 at 06:11PM

14
#375 - hepebexè / @hepebexe

12/17/2020 at 06:52PM

14
#376 - Michel Viktor / @tomkpz

07/30/2021 at 01:06AM

14
#377 - Jean George / @JeanGeo20504212

09/28/2021 at 01:24PM

15
#378 - Edgar Hipp / @EdgarHipp

05/09/2014 at 04:00PM

15
#379 - Jeff Parent / @jeffparent

05/09/2014 at 05:32PM

15
#380 - lastsseldon / @lastsseldon

05/09/2014 at 08:33PM

15
#381 - Gwilym Kuiper / @gwilymk

05/09/2014 at 09:01PM

15
#382 - daveseibert / @daveseibert

05/09/2014 at 09:12PM

15
#383 - ryk / @rykarn

05/10/2014 at 07:52AM

15
#384 - Matt Walker / @_walkermatt

05/10/2014 at 07:35PM

15
#385 - Par Narvi / @ParNarvi

05/11/2014 at 04:25PM

15
#386 - mnx / @mnxx

05/16/2014 at 07:54AM

15
#387 - jolka / @jolka19296078

05/22/2014 at 02:56PM

15
#388 - Apostolis Hardalias / @hardalias

05/24/2014 at 12:18PM

15
#389 - Justin Weidner / @justinweidner

05/27/2014 at 03:26PM

15
#390 - Quota / @Quotad

05/30/2014 at 07:34AM