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

647 active golfers, 1928 entries

Leaderboard (lowest score wins):
17
#511 - Алексанр Цыганков / @capybarov

02/13/2015 at 03:32PM

17
#512 - Amer / @amerlyq

02/24/2015 at 03:37PM

17
#513 - octotep / @octotep

02/25/2015 at 12:56AM

17
#514 - shugen / @shugeno

03/04/2015 at 09:36PM

17
#515 - Swastik / @__swastik

03/25/2015 at 01:55PM

17
#516 - talineo / @talineo_

04/10/2015 at 11:34PM

17
#517 - Hendrik Lammers / @hendriklammers

04/18/2015 at 06:29PM

17
#518 - Martijn Theunissen / @Martijn_______

04/21/2015 at 07:00PM

17
#519 - Mark Saiget / @MarkSaiget

04/24/2015 at 05:40AM

17
#520 - Zach Morgan / @zpmorgan

05/02/2015 at 10:00AM

17
#521 - Agostino Hernandez / @vimagostino

07/08/2015 at 11:55PM

17
#522 - Barthelemy Dagenais / @bartdag

07/12/2015 at 09:03AM

17
#523 - Albert Pumarola / @AlbertPumarola

08/07/2015 at 03:33PM

17
#524 - Kirill Cherkashin / @kirjs

09/15/2015 at 02:30PM

17
#525 - Mark Clay / @dxftfdlz

10/03/2015 at 11:55PM

17
#526 - ハチポケッツ / @8pockets

12/14/2015 at 12:41AM

17
#527 - twenty2twoss / @twenty2twoss

01/20/2016 at 06:29PM

17
#528 - Etienne Tremel / @etiennetremel

02/07/2016 at 11:49AM

17
#529 - Pratap Koritala / @pratap_koritala

02/17/2016 at 11:23AM

17
#530 - ɹǝsnɐɥsıʇnɹ uoɾ / @JonRutis

03/01/2016 at 05:40PM

17
#531 - Yahyalexandre33 / @yahyalexandre33

03/16/2016 at 09:29AM

17
#532 - Feras / @faldah

05/01/2016 at 04:16AM

17
#533 - iNaKoll / @iNaKoll

05/07/2016 at 09:39PM

17
#534 - Ben Hill / @KaizenSoze70

05/09/2016 at 04:24PM

17
#535 - Tom / @CronutFacts

05/31/2016 at 02:28AM

17
#536 - Ameen P / @Ameen_P1

06/23/2016 at 05:05PM

17
#537 - Timothy Caleb Nordlo / @tnordloh

06/27/2016 at 11:08PM

17
#538 - Thiago Belem / @TiuTalk

08/31/2016 at 04:11AM

17
#539 - TweetDreams / @TweetMusicians

10/09/2016 at 06:21AM

17
#540 - KangHun Seo / @shirano80

11/18/2016 at 05:40AM