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):
14
#331 - Nils Moehrle / @MoehrleNils

05/06/2019 at 08:52PM

14
#332 - Arno / @arnoxmp

05/08/2019 at 08:48PM

14
#333 - Phoon / @justflashhim

05/10/2019 at 10:39PM

14
#334 - albalitz / @_albalitz

06/06/2019 at 01:01PM

15
#335 - Edgar Hipp / @EdgarHipp

05/09/2014 at 04:00PM

15
#336 - Jeff Parent / @jeffparent

05/09/2014 at 05:32PM

15
#337 - lastsseldon / @lastsseldon

05/09/2014 at 08:33PM

15
#338 - Gwilym Kuiper / @gwilymk

05/09/2014 at 09:01PM

15
#339 - daveseibert / @daveseibert

05/09/2014 at 09:12PM

15
#340 - ryk / @rykarn

05/10/2014 at 07:52AM

15
#341 - Matt Walker / @_walkermatt

05/10/2014 at 07:35PM

15
#342 - Par Narvi / @ParNarvi

05/11/2014 at 04:25PM

15
#343 - mnx / @mnxx

05/16/2014 at 07:54AM

15
#344 - jolka / @jolka19296078

05/22/2014 at 02:56PM

15
#345 - Apostolis Hardalias / @hardalias

05/24/2014 at 12:18PM

15
#346 - Justin Weidner / @justinweidner

05/27/2014 at 03:26PM

15
#347 - Quota / @Quotad

05/30/2014 at 07:34AM

15
#348 - Augusto Pascutti / @augustohp

06/02/2014 at 09:36PM

15
#349 - heron bird / @urzonn1

06/05/2014 at 10:36PM

15
#350 - Russ Adams / @rustushki

06/07/2014 at 01:30PM

15
#351 - Tim Seyschab / @SeyschabTim

06/12/2014 at 07:37PM

15
#352 - Vinicius Souza / @vsouzas

06/14/2014 at 05:46PM

15
#353 - Jeff Klein / @ravioli_jazz

06/16/2014 at 06:56PM

15
#354 - TapTemplate / @TapTemplate

06/28/2014 at 01:58AM

15
#355 - sergio filho / @sergio3010

07/15/2014 at 02:57AM

15
#356 - Joakim Hansen / @gnofs

07/31/2014 at 12:50PM

15
#357 - Oliver Christ / @0liverChrist

08/04/2014 at 09:12PM

15
#358 - Seth Rader / @f4uLT

08/12/2014 at 11:48PM

15
#359 - Ingolf / @bl4ckb1rd_LE

08/30/2014 at 10:42AM

15
#360 - Dr4k3 / @Dr4k3_LE

08/30/2014 at 10:51AM