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

646 active golfers, 1921 entries

Leaderboard (lowest score wins):
14
#301 - Carl Egbert / @CarlOEgbert

06/11/2017 at 08:46PM

14
#302 - Adam Kożuch / @adamkozuch

08/15/2017 at 01:52AM

14
#303 - Brian Hall / @_bruab_

10/05/2017 at 03:44PM

14
#304 - Luke Bryant / @LukeBryant55

11/28/2017 at 03:22PM

14
#305 - John C Shea / @MHSSachems

01/29/2018 at 12:13PM

14
#306 - Lisa Ugray / @lisa_ugray

03/18/2018 at 01:12PM

14
#307 - Jonathan Camilleri / @Too_Many_Taken

05/26/2018 at 12:57PM

14
#308 - 赤佐田奈葉 / @akasatanaha_

06/22/2018 at 08:49AM

14
#309 - qed / @qed13308565

07/26/2018 at 12:13AM

14
#310 - Rajesh Sharma / @deepredsky

07/30/2018 at 07:27PM

14
#311 - Mihai / @mihaicristiant

12/04/2018 at 01:56PM

14
#312 - Timothy Michael Fox / @Timothy_M_Fox

12/18/2018 at 06:07PM

14
#313 - Bob_V / @Bob_V

12/18/2018 at 07:56PM

14
#314 - Patrick Lavin / @LavinComputes

01/30/2019 at 08:00PM

14
#315 - Timothy Bryan / @tim_bryan

02/22/2019 at 04:30PM

14
#316 - Zach Miller / @barizachsy

02/27/2019 at 04:13AM

14
#317 - Maarten Staa / @SeriousSpoon

02/28/2019 at 02:26PM

14
#318 - ahm4711 / @ahm4711

03/02/2019 at 08:51PM

14
#319 - andrwyoung / @andrwyoung1

03/03/2019 at 06:27AM

14
#320 - ui / @ui61065627

03/19/2019 at 01:30AM

15
#321 - Edgar Hipp / @EdgarHipp

05/09/2014 at 04:00PM

15
#322 - Jeff Parent / @jeffparent

05/09/2014 at 05:32PM

15
#323 - lastsseldon / @lastsseldon

05/09/2014 at 08:33PM

15
#324 - Gwilym Kuiper / @gwilymk

05/09/2014 at 09:01PM

15
#325 - daveseibert / @daveseibert

05/09/2014 at 09:12PM

15
#326 - ryk / @rykarn

05/10/2014 at 07:52AM

15
#327 - Matt Walker / @_walkermatt

05/10/2014 at 07:35PM

15
#328 - Par Narvi / @ParNarvi

05/11/2014 at 04:25PM

15
#329 - mnx / @mnxx

05/16/2014 at 07:54AM

15
#330 - jolka / @jolka19296078

05/22/2014 at 02:56PM