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

711 active golfers, 2138 entries

Leaderboard (lowest score wins):
13
#241 - Vladimir Leskov / @vladimirlesk

11/24/2019 at 06:12PM

13
#242 - James Casey / @hanavi

12/21/2019 at 11:53PM

13
#243 - 임덕윤 / @SnLHUF5ZYJXqI1m

01/01/2020 at 05:21PM

13
#244 - Delon / @delonleonard

01/04/2020 at 01:21PM

13
#245 - Maxim / @alfa101

01/08/2020 at 03:49AM

13
#246 - countime / @countime1

03/13/2020 at 07:44AM

13
#247 - Ryan Nevius / @ryannevius

03/27/2020 at 05:23PM

13
#248 - Jason / @roosjason

05/14/2020 at 02:14PM

13
#249 - 于吉星 / @fishermryn

05/29/2020 at 02:41AM

13
#250 - Ming Dai / @MingDai2

07/01/2020 at 03:38PM

14
#251 - Kai Yuan / @kentyuan

05/09/2014 at 04:48PM

14
#252 - Carlos López / @morrizon

05/09/2014 at 07:21PM

14
#253 - Arthur叔 / @Arthurljg

05/10/2014 at 04:32AM

14
#254 - RobertT / @techrt2050

05/11/2014 at 05:08AM

14
#255 - Richard Veneracion / @rveneracion

05/11/2014 at 07:22AM

14
#256 - Bambu / @bambumandinga

05/11/2014 at 08:05PM

14
#257 - nikola chochkov / @gooodini

05/14/2014 at 09:47AM

14
#258 - 3X4n5 / @3X4n5

05/15/2014 at 01:48PM

14
#259 - Dave C / @dmlc133

05/15/2014 at 03:11PM

14
#260 - ところたん / @tokoro10g

05/19/2014 at 01:43AM

14
#261 - たかきの / @srtkmsw

05/22/2014 at 09:47AM

14
#262 - Grigoriy Alexeev / @GrigoriyAlexeev

05/24/2014 at 12:34PM

14
#263 - vansan / @VinceVansan

06/02/2014 at 09:16PM

14
#264 - Steffen Siering / @ursobln

06/02/2014 at 11:06PM

14
#265 - Emil Soman / @emilsoman

06/05/2014 at 10:12PM

14
#266 - kwa / @kwa129

06/14/2014 at 07:57AM

14
#267 - Crazy Wizdom / @crazywizdom

06/23/2014 at 09:00PM

14
#268 - ドラゴン井門 / @ido_mazine

06/25/2014 at 08:01AM

14
#269 - James Scriven / @JamesDScriven

07/06/2014 at 01:42PM

14
#270 - Jaron R. Hendrix / @Ronamo

07/08/2014 at 05:27PM