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

728 active golfers, 2215 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

13
#251 - roudens / @roudens2

12/20/2020 at 03:52AM

13
#252 - Ray Dennis / @raysden

01/08/2021 at 09:31PM

13
#253 - Jung Yeon Park / @park_jungy

01/11/2021 at 04:28PM

13
#254 - A A A / @37fatos

01/16/2021 at 07:48PM

13
#255 - nedlog / @nedlog18

05/27/2021 at 06:39AM

13
#256 - Arya Kumar / @SusSquirrel

05/29/2021 at 03:56PM

13
#257 - lydxn / @lydxn1

07/29/2021 at 11:22PM

13
#258 - Flimsy Giraffe / @flimsy_giraffe

11/28/2021 at 05:38PM

13
#259 - Joshua Marple / @JoshuaMarple1

12/17/2021 at 05:17AM

13
#260 - Ofer Yehuda / @OferYehuda

02/24/2022 at 04:15PM

13
#261 - russellzhaomao / @russellzhaomao

05/26/2022 at 02:24AM

14
#262 - Kai Yuan / @kentyuan

05/09/2014 at 04:48PM

14
#263 - Carlos López / @morrizon

05/09/2014 at 07:21PM

14
#264 - Arthur叔 / @Arthurljg

05/10/2014 at 04:32AM

14
#265 - RobertT / @techrt2050

05/11/2014 at 05:08AM

14
#266 - Richard Veneracion / @rveneracion

05/11/2014 at 07:22AM

14
#267 - Bambu / @bambumandinga

05/11/2014 at 08:05PM

14
#268 - nikola chochkov / @gooodini

05/14/2014 at 09:47AM

14
#269 - 3X4n5 / @3X4n5

05/15/2014 at 01:48PM

14
#270 - Dave C / @dmlc133

05/15/2014 at 03:11PM