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):
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

13
#233 - Miłosz Łakomy / @foobar01123

07/25/2019 at 09:56AM

13
#234 - sooqua / @sooqua

08/09/2019 at 04:45AM

13
#235 - Wistan Chou / @wisty97

08/15/2019 at 07:55PM

13
#236 - Martin Delille / @martinodelilo

08/22/2019 at 12:25PM

13
#237 - Sebastian / @diasitede

10/05/2019 at 12:37PM

13
#238 - Viktor Styrud / @ViktorStyrud

10/10/2019 at 11:49AM

13
#239 - vimgolfer / @vimgolfer7

10/22/2019 at 01:54AM

13
#240 - Mario Olofo / @mario_olofo

10/23/2019 at 10:48PM