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):
13
#211 - Roger Bongers / @RogerBongers

10/07/2018 at 05:57PM

13
#212 - Dax / @zacoxi

11/09/2018 at 06:33AM

13
#213 - i33 / @i3342th

11/14/2018 at 08:24AM

13
#214 - name / @name65894813

11/19/2018 at 04:46PM

13
#215 - faisal / @faisalhackshah

11/26/2018 at 05:26AM

13
#216 - band / @band26376522

12/08/2018 at 11:06PM

13
#217 - 14758f1afd44c09b7992073ccf00b43d / @14758f1afd44c01

12/18/2018 at 08:37PM

13
#218 - Bennett / @bennettbackward

12/19/2018 at 12:42PM

13
#219 - Dan Yeaw / @danyeaw

01/13/2019 at 02:02AM

13
#220 - Henrique Malheiro / @rike09

01/24/2019 at 12:18PM

13
#221 - Bumazhka / @Bumazhka

02/10/2019 at 08:38AM

13
#222 - Titouan Teyssier / @TitouanT_

03/02/2019 at 09:05PM

13
#223 - zenwalker / @zenwalker93

03/11/2019 at 03:52PM

13
#224 - k24w24 / @k24w24

03/14/2019 at 03:43AM

13
#225 - omrisarig / @omrisarig

03/20/2019 at 08:04PM

13
#226 - james_bunch / @james_bunch

05/01/2019 at 05:08AM

13
#227 - ow / @ow34480012

05/01/2019 at 09:35PM

13
#228 - Grant / @grant_7788

05/02/2019 at 08:55AM

13
#229 - Frede Emil / @Frede_Eb

05/21/2019 at 09:24PM

13
#230 - maximilian / @maximil61408276

05/21/2019 at 09:55PM

13
#231 - mkaminaga / @mkmng3

07/01/2019 at 07:51AM

13
#232 - Chester Yap / @Chest_ErYap

07/07/2019 at 06:06PM

14
#233 - Kai Yuan / @kentyuan

05/09/2014 at 04:48PM

14
#234 - Carlos López / @morrizon

05/09/2014 at 07:21PM

14
#235 - Arthur叔 / @Arthurljg

05/10/2014 at 04:32AM

14
#236 - RobertT / @techrt2050

05/11/2014 at 05:08AM

14
#237 - Richard Veneracion / @rveneracion

05/11/2014 at 07:22AM

14
#238 - Bambu / @bambumandinga

05/11/2014 at 08:05PM

14
#239 - nikola chochkov / @gooodini

05/14/2014 at 09:47AM

14
#240 - 3X4n5 / @3X4n5

05/15/2014 at 01:48PM