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

668 active golfers, 2000 entries

Leaderboard (lowest score wins):
21
#631 - luffy / @raxcoi

06/09/2015 at 10:47AM

21
#632 - Stop and think / @ms_uncountable

07/06/2017 at 12:09PM

21
#633 - churaki / @churaki

01/26/2019 at 04:42AM

21
#634 - Vimfiz / @vimfiz

04/05/2019 at 12:43AM

21
#635 - Rezo Zakala / @rzakala

05/26/2019 at 03:23PM

22
#636 - Jorge Garcia / @slash28cu

05/18/2014 at 10:10AM

22
#637 - Корнев Руслан / @woto7

06/15/2014 at 04:34PM

22
#638 - Max R / @brewtroin

06/22/2014 at 05:58PM

22
#639 - Wandering ponderer / @0proxycon

07/17/2014 at 01:08PM

22
#640 - Simon Mölzer / @h0wser

08/25/2014 at 03:19PM

22
#641 - Glauco Pires / @grpires

11/25/2014 at 12:31AM

22
#642 - Eric Biven / @EricBiven

01/01/2015 at 02:28AM

22
#643 - Dr. Rev. J. "Paranoid Android" Kirchartz / @JKirchartz

01/16/2015 at 04:15AM

22
#644 - uɐɥlnƃ uɐɯɹǝ / @egulhan

03/15/2015 at 07:00PM

22
#645 - Alex Bartol / @alexbartol

05/07/2015 at 08:08PM

22
#646 - Marcus Buffett / @MarcusBuffett

10/05/2015 at 07:00PM

22
#647 - adrien frediani / @fredianiadrien

12/18/2015 at 09:23PM

22
#648 - Kayne West / @portal_narlish

04/25/2016 at 07:43AM

22
#649 - 默罕默德 / @Rt6RjEAJ987Woes

01/22/2019 at 01:34PM

22
#650 - 김형창 / @uVmEMZsCgcYvqZi

04/05/2019 at 09:28AM

23
#651 - Martin Delille / @martinodelilo

05/10/2014 at 12:32PM

23
#652 - Michael Leong / @mhwleong

12/03/2014 at 03:47PM

23
#653 - diwa / @Di_nate_

12/18/2018 at 03:34AM

24
#654 - Victor Bjelkholm / @VictorBjelkholm

06/01/2014 at 12:55PM

24
#655 - No Holiness / @NoHoliness

08/14/2014 at 06:39PM

24
#656 - Ryo Sakikawa / @ryosakikawa

09/17/2014 at 07:12AM

24
#657 - Noah Ruderman / @noahc66260

09/27/2014 at 08:38AM

25
#658 - robby bustle / @bobbyrussa

05/29/2014 at 04:06AM

25
#659 - d c / @chikenwaffle

07/11/2014 at 11:10PM

25
#660 - Paweł Max K. / @ktorek

10/01/2014 at 05:45PM