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

680 active golfers, 2037 entries

Leaderboard (lowest score wins):
22
#661 - 김형창 / @uVmEMZsCgcYvqZi

04/05/2019 at 09:28AM

23
#662 - Michael Leong / @mhwleong

12/03/2014 at 03:47PM

23
#663 - diwa / @Di_nate_

12/18/2018 at 03:34AM

23
#664 - Christian / @paierlep

09/03/2019 at 10:10PM

24
#665 - Victor Bjelkholm / @VictorBjelkholm

06/01/2014 at 12:55PM

24
#666 - No Holiness / @NoHoliness

08/14/2014 at 06:39PM

24
#667 - Ryo Sakikawa / @ryosakikawa

09/17/2014 at 07:12AM

24
#668 - Noah Ruderman / @noahc66260

09/27/2014 at 08:38AM

24
#669 - Vim Golfer / @VimGolfer6

08/22/2019 at 12:11PM

25
#670 - robby bustle / @bobbyrussa

05/29/2014 at 04:06AM

25
#671 - d c / @chikenwaffle

07/11/2014 at 11:10PM

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

10/01/2014 at 05:45PM

25
#673 - ಸುಬ್ರಹ್ಮಣ್ಯ ಜೋಶಿ / @subbucoding

03/29/2015 at 02:35AM

25
#674 - Rijnard van Tonder / @rvtond

04/27/2015 at 02:14AM

25
#675 - Jurica / @Jurica34581259

11/16/2018 at 12:01PM

26
#676 - Justin Knag / @justinknag

08/24/2014 at 07:10AM

26
#677 - Luis Rodriguez / @luisthecoder

11/14/2018 at 11:43PM

27
#678 - BJ Terry / @ThatBJTerry

05/20/2014 at 08:16AM

28
#679 - david@@@@wang / @davidwa86717152

11/16/2018 at 09:01AM

30
#680 - BitLad / @BitLad

01/31/2018 at 06:37PM