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

685 active golfers, 2049 entries

Leaderboard (lowest score wins):
14
#331 - Timothy Bryan / @tim_bryan

02/22/2019 at 04:30PM

14
#332 - Zach Miller / @barizachsy

02/27/2019 at 04:13AM

14
#333 - Maarten Staa / @SeriousSpoon

02/28/2019 at 02:26PM

14
#334 - ahm4711 / @ahm4711

03/02/2019 at 08:51PM

14
#335 - andrwyoung / @andrwyoung1

03/03/2019 at 06:27AM

14
#336 - ui / @ui61065627

03/19/2019 at 01:30AM

14
#337 - alekfed / @alek_fed

04/15/2019 at 11:39AM

14
#338 - Gitsnik / @dracyrys

05/04/2019 at 11:10AM

14
#339 - Nils Moehrle / @MoehrleNils

05/06/2019 at 08:52PM

14
#340 - Arno / @arnoxmp

05/08/2019 at 08:48PM

14
#341 - Phoon / @justflashhim

05/10/2019 at 10:39PM

14
#342 - albalitz / @_albalitz

06/06/2019 at 01:01PM

14
#343 - José / @AngelGaldamez

08/31/2019 at 06:00AM

14
#344 - monaqa / @mo_naqa

09/16/2019 at 10:29AM

14
#345 - Baine Wedlock / @BaineWedlock

09/24/2019 at 12:44PM

14
#346 - Lory / @Lory46845742

11/13/2019 at 09:04AM

15
#347 - Edgar Hipp / @EdgarHipp

05/09/2014 at 04:00PM

15
#348 - Jeff Parent / @jeffparent

05/09/2014 at 05:32PM

15
#349 - lastsseldon / @lastsseldon

05/09/2014 at 08:33PM

15
#350 - Gwilym Kuiper / @gwilymk

05/09/2014 at 09:01PM

15
#351 - daveseibert / @daveseibert

05/09/2014 at 09:12PM

15
#352 - ryk / @rykarn

05/10/2014 at 07:52AM

15
#353 - Matt Walker / @_walkermatt

05/10/2014 at 07:35PM

15
#354 - Par Narvi / @ParNarvi

05/11/2014 at 04:25PM

15
#355 - mnx / @mnxx

05/16/2014 at 07:54AM

15
#356 - jolka / @jolka19296078

05/22/2014 at 02:56PM

15
#357 - Apostolis Hardalias / @hardalias

05/24/2014 at 12:18PM

15
#358 - Justin Weidner / @justinweidner

05/27/2014 at 03:26PM

15
#359 - Quota / @Quotad

05/30/2014 at 07:34AM

15
#360 - Augusto Pascutti / @augustohp

06/02/2014 at 09:36PM