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

661 active golfers, 1975 entries

Leaderboard (lowest score wins):
14
#301 - J. Cosa / @esoesotracosa

01/18/2017 at 03:40PM

14
#302 - Reinaldo Astudillo / @astudillor

03/22/2017 at 11:09PM

14
#303 - Solomon / @Trugbildjaeger

04/02/2017 at 12:57PM

14
#304 - Alex Linden / @alexwlinden1

04/19/2017 at 06:46PM

14
#305 - Carl Egbert / @CarlOEgbert

06/11/2017 at 08:46PM

14
#306 - Adam Kożuch / @adamkozuch

08/15/2017 at 01:52AM

14
#307 - Brian Hall / @_bruab_

10/05/2017 at 03:44PM

14
#308 - Luke Bryant / @LukeBryant55

11/28/2017 at 03:22PM

14
#309 - John C Shea / @MHSSachems

01/29/2018 at 12:13PM

14
#310 - Lisa Ugray / @lisa_ugray

03/18/2018 at 01:12PM

14
#311 - Jonathan Camilleri / @Too_Many_Taken

05/26/2018 at 12:57PM

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

06/22/2018 at 08:49AM

14
#313 - qed / @qed13308565

07/26/2018 at 12:13AM

14
#314 - Rajesh Sharma / @deepredsky

07/30/2018 at 07:27PM

14
#315 - Mihai / @mihaicristiant

12/04/2018 at 01:56PM

14
#316 - Timothy Michael Fox / @Timothy_M_Fox

12/18/2018 at 06:07PM

14
#317 - Bob_V / @Bob_V

12/18/2018 at 07:56PM

14
#318 - Patrick Lavin / @LavinComputes

01/30/2019 at 08:00PM

14
#319 - Timothy Bryan / @tim_bryan

02/22/2019 at 04:30PM

14
#320 - Zach Miller / @barizachsy

02/27/2019 at 04:13AM

14
#321 - Maarten Staa / @SeriousSpoon

02/28/2019 at 02:26PM

14
#322 - ahm4711 / @ahm4711

03/02/2019 at 08:51PM

14
#323 - andrwyoung / @andrwyoung1

03/03/2019 at 06:27AM

14
#324 - ui / @ui61065627

03/19/2019 at 01:30AM

14
#325 - alekfed / @alek_fed

04/15/2019 at 11:39AM

14
#326 - Gitsnik / @dracyrys

05/04/2019 at 11:10AM

14
#327 - Nils Moehrle / @MoehrleNils

05/06/2019 at 08:52PM

14
#328 - Arno / @arnoxmp

05/08/2019 at 08:48PM

14
#329 - Phoon / @justflashhim

05/10/2019 at 10:39PM

15
#330 - Edgar Hipp / @EdgarHipp

05/09/2014 at 04:00PM